比较最大值去重 select a.id,a.name,a.age from A where not exists (select id from A where id>a.id) select a.id,a.name,a.age from A where not exists (select id from A where id>a.id)