Forum Moderators: open
sorry for not introducing myself in proper area of forum, but i'm almost run out of time. I have a problem with mysql query. It's little bit hard to describe it, but i have to give a try. I have simple table with blog posts:
posts:
id
text
time
sticky
Posts should be ordered by time desc and that's ok. But, my sticky column is not regular sticky column from other blogs and forums. I mean, i have more sticky posts and i don't want them all to be stick to the top of the list.
I have this structure of content: 6 normal posts and then one sticky, one per day in the week. On the index page are listed posts from last 3 weeks. What i want is to sort them in this order:
s p p p p p p s p p p p p p s p p p p p p
In every group of 7 posts there is one sticky and it should be fixed to the top of that group, but not all three sticky posts to be fixed at the top. So, it's basically 3 separate lists with 7 elements and every list have one sticky post at the top.
I'm not sure if i should do this with table union, or group by or combination, i'm not sure. If anyone has any idea, i'd really appreciate if he could share it. :)
Thanks in advance.
Milan