按照指定顺序排序
使用场景:需要查询捆号为10,23,9...的数据,查询结果也是按照输入的顺序排列
sql:
select * from store
where xh in (10,23,9)
order by case xh
when 10 then 1
when 23 then 2
when 9 then 3
end
2022-09-17 07:35:06
使用场景:需要查询捆号为10,23,9...的数据,查询结果也是按照输入的顺序排列
sql:
select * from store
where xh in (10,23,9)
order by case xh
when 10 then 1
when 23 then 2
when 9 then 3
end