【求助】如何倒序SQL的查询结果

god_fish 2012-09-04 11:06:34
我想查询一个时间段内,最新的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;

因为这样的结果是按时间降序排列的,我想让查询结果按时间升序排列,请问表达式该怎么写?
...全文
610 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
god_fish 2012-09-04
  • 打赏
  • 举报
回复
OK,3Q
WWWWA 2012-09-04
  • 打赏
  • 举报
回复
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
WWWWA 2012-09-04
  • 打赏
  • 举报
回复
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

2,596

社区成员

发帖
与我相关
我的任务
社区描述
Sybase相关技术讨论区
社区管理员
  • Sybase社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧