select *from (select *,row_number() over(parititon by id,name order by age desc) rnfrom table_name) twhere rn<=1--desc不加就是选年纪小的那行