获取每一组的第一条记录
select t.* from(
select p.*,row_number() over(partition by 分组字段 order by 排序字段 desc) as num from 表 p) as t
where t.num=1
select t.* from(
select p.*,row_number() over(partition by 分组字段 order by 排序字段 desc) as num from 表 p) as t
where t.num=1