取出每组的第一个
select *from (select * ,RANK ( ) OVER( PARTITION by org order by reportcode asc) PartionNumfrom test) twhere PartionNum = 1
rog:分组的字段
reportcode :排序字段
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3