当前位置: 代码迷 >> SQL >> 怎么倒序SQL的查询结果
  详细解决方案

怎么倒序SQL的查询结果

热度:80   发布时间:2016-05-05 13:34:14.0
【求助】如何倒序SQL的查询结果
我想查询一个时间段内,最新的N条记录,如,
select * from Table where time between '2012-09-03 00:00:00' and '2012-09-03 11:36:59'order by time desc limit 0,100;

因为这样的结果是按时间降序排列的,我想让查询结果按时间升序排列,请问表达式该怎么写?

------解决方案--------------------
select * from (
select * from Table where time between '2012-09-03 00:00:00' and '2012-09-03 11:36:59'order by time desc limit 0,100) a order by time
  相关解决方案