标签:
业务需用为数据按倒序排序,当天数据排在以往日期前面,但当天数据需按小时进行升序排列
select *from
(
select vcTitle,dtBeginDate,case when dtBeginDate<=getdate() then 1 else 2 end tt
from TableA
) a
order by Convert(varchar(10),dtBeginDate,120)desc,tt desc,dtBeginDate
标签:
原文地址:http://www.cnblogs.com/ghelement/p/4511315.html