一、按表里的某列先分组,再按另外一列进行组内排序
select t.*,row_number() over(partition by t.分组字段 order by t.排序字段 asc) row_number from TABLE_NAME t
解析:用分组聚合函数
ROW_NUMBER() OVER( [PARTITION BY column_1, column_2,…] [ORDER BY column_3,column_4,…] )