SELECT ID,T_STATUS,T_TIME FROM
s
order by
CASE WHEN T_STATUS = 0 THEN 100 ELSE 1000 END,
case when T_STATUS = 0 then T_TIME end ,
case when T_STATUS != 0 then T_TIME end desc;
sql根据同一字段不同值时间升序将序
最新推荐文章于 2024-08-23 11:09:50 发布
SELECT ID,T_STATUS,T_TIME FROM
s
order by
CASE WHEN T_STATUS = 0 THEN 100 ELSE 1000 END,
case when T_STATUS = 0 then T_TIME end ,
case when T_STATUS != 0 then T_TIME end desc;