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:
你可以使用子查询:
SELECT a.* FROM (SELECT * FROM yourtable ORDER BY date DESC Limit 4) a ORDER BY a.Date
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.