Oracle 以某字段分组,以某字段排序,取前几条

来源:互联网 发布:php.ini cookie设置 编辑:程序博客网 时间:2024/06/06 15:42


select * from (select 表.*, row_number() over(partition by 以此字段为分组  order by 以此字段排序 desc) rn

from 表) where rn=1   --表示取第一个

0 0