you can use subquery :
SELECT a.* FROM (SELECT * FROM yourtable ORDER BY date DESC Limit 4) a ORDER BY a.Date
Question
This is kind of straight forward.
I want to ORDER BY date DESC Limit 4
and then I want to ORDER BY date ASC
on that result, so just 4-games from the middle of the big table with ASC date order, any ideas?
Just ORDER BY date ASC Limit 4
Does not work!
What I have:
What I get:
What I want:
Solution
you can use subquery :
SELECT a.* FROM (SELECT * FROM yourtable ORDER BY date DESC Limit 4) a ORDER BY a.Date
OTHER TIPS
if you want to get the last four rows from table
select * from table order by date desc limit 0,4
if you want to get the first four rows from table
select * from table order by date asc limit 0,4