您的位置:首页 > 博客中心 > 数据库 >

oracle 自动添加序号列 排序

时间:2022-03-13 23:58

      select      HSL.sortno,
                    HSL.B,
                    HSL.A,
                    row_number() over(order by sortno desc) xh
               from (select  t.B, t.A ,
                            case
                              when t.B = ‘股份公司‘ then
                               9999999
                              else
                               t.A   end as sortno
                       from 表 t
                    ) HSL

热门排行

今日推荐

热门手游