取出每组的第一个
select
*
from (select
* ,RANK ( ) OVER( PARTITION by org order by reportcode asc) PartionNum
from test
) t
where PartionNum = 1
rog:分组的字段
reportcode :排序字段
取出每组的第一个
select
*
from (select
* ,RANK ( ) OVER( PARTITION by org order by reportcode asc) PartionNum
from test
) t
where PartionNum = 1
rog:分组的字段
reportcode :排序字段