测试数据如下
例子1:要求对NAME相同的值只取一条即可
select *
from test t
where t.rowid in (select max(rowid) from test group by name)
例子1:要求对NAME相同的值只取一条且AGE值最大
select *
from test t
where (t.name, t.age) in (select name, max(age) from test group by name)
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/4090.html