I am using the below query to paginate posts on my site:
select * from songs t1 join (
select to_days(date) day from songs
group by day
order by day desc
limit $start_row, $items_per_page
) t2
on to_days(t1.date) = t2.day
Depending on my $start_row and $items_per_page this will return all the posts for say, the last 7 days. Regardless of if there was more than 1 post per day or a day is empty and skipped.
For example:

Above the query has correctly returned all the posts from the latest 7 days. Today. Yesterday. The day before that and so on…
However if you look at the table id 12## values on the far left, and time stamp day values 73#### on the far right. You will see they are grouped backwards.
How do I switch this query around so that it returns the same results in the same grouping but in a reverse order?
For example:
Oh My! – Run This Town(TMS remix)
Lost Mapaches-Back To Basics (La Royale Remix)
Dimitri from Paris & DJ Rocca-I Need A Reason For LIving (Radio Mix)
Chromeo – Hot Mess (23 Dubstep Remix)
and so on… I tried removing the desc value but that just returns the grouping from the oldest entries in the table.
I would order your data on the outside of the subquery (note the last line), please adjust last line for asc / desc or if you want to order by.