日期:2014-05-18  浏览次数:20436 次

求SQL先按大于当前时间升序排序,再按小于当前时间降序排序
现在有一个会议表
现在要求列出会议列表
先按还没有到会议时间升序排序,
再按已过会议时间的倒序排序

这个SQL怎么写

谢谢

------解决方案--------------------
给测试数据
------解决方案--------------------
select * from tb order by case when meetingtime>=getdate() then 0 else 1 end,abs(datediff(ss,getdate(),meetingtime)) asc