取出每组的第一个

 

select
*
from (select
* ,RANK ( ) OVER( PARTITION by org order by reportcode asc) PartionNum
from test
) t
where PartionNum = 1

 

rog:分组的字段

reportcode :排序字段

相关文章:

  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
  • 2021-08-06
  • 2021-09-28
  • 2021-10-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2022-12-23
  • 2021-06-01
  • 2021-12-19
  • 2021-12-26
相关资源
相似解决方案