ORACLE sql 排序 根据两个条件排序,根据id号由小到大排序,同时country字段是北京的排最前面前面,其次上海,。。大连,最后是其他城市,怎么写?

 

写法如下:
select * from provice
order by (case when country='北京' then 0
when country='上海' then 1
when country='广东' then 2
when country='深圳' then 3
when country='杭州' then 4
when country='大连' then 5
else 6 end) ,id desc

相关文章:

  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2021-12-06
  • 2021-11-10
  • 2021-10-24
  • 2021-10-31
相关资源
相似解决方案