SQL先按照时间排序然后按照状态排序怎么弄?

2025-05-18 17:44:21
推荐回答(2个)
回答(1):

select * from sport_bisai order by 比赛时间,状态

就上面这样就可以了,中文字符排序,按拼音首字母来的,

进行中(J),未开始(W),已结束(Y),J

回答(2):

select * from sport_bisai order by 比赛时间, case 状态 when '进行中' then 0 when '未开始' then 1 when '已结束' then 2 end