标签: sql
我将字段状态设为enum(1,2,3,4,5),我需要order 2,3 DESC然后1,4,5 DESC。结果必须是3,2,5,4,1
enum(1,2,3,4,5)
order 2,3 DESC
1,4,5 DESC
3,2,5,4,1
答案 0 :(得分:1)
任意顺序:
order by case [enum] when 3 then 1 when 2 then 2 when 5 then 3 when 4 then 4 when 1 then 5 end