首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

怎么倒序SQL的查询结果

2012-09-17 
【求助】如何倒序SQL的查询结果我想查询一个时间段内,最新的N条记录,如,select * from Table where time bet

【求助】如何倒序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

热点排行