select * from ( select row_number() over(partition by 分组字段 order by 排序字段) as rownum -- 排序并分组 , * -- 所需显示的字段 from 表名 ) as T where T.rownum = 1