select 结果字段 from ( select *,row_number() over(partition by 分组字段 order by 排序表达式) row_number from 表名 ) where row_number=1