sql语句使用case when实现列排序

直接示例代码:

根据correctstatus列的三种状态值排序

select * from GIS_FEATURECORRECTION
 order by case correctstatus
            when '待审核' then 1
            when '待处理' then 2
            when '已完成' then 3
            else 4
          end,
          gis_featurecorrection_pkid desc;


猜你喜欢

转载自blog.csdn.net/pp_fzp/article/details/77370833
今日推荐