Oracle對按A字段排序,B字段分組只取第一個的方法

注意儘可能不要用*,改用必須取用的字段名sql select t.* from (select a.*, row_number() over(partition by a.分組字段 order by a.排序字段 desc) rw from 表名 a) t where t.rw = 1
相關文章
相關標籤/搜索