取出每组的第一个
select *from (select * ,RANK ( ) OVER( PARTITION by org order by reportcode asc) PartionNumfrom test) twhere PartionNum = 1
rog:分组的字段
reportcode :排序字段
Powered by: 博客园 Copyright © 2024 生命如风 Powered by .NET 9.0 on Kubernetes