select * from tablename as a
where not exists (
select 1 from tablename as b
where b.name=a.name and b.id>a.id
talename:要去重复的表
name:需要去重复的字段,可以有多个字段
ID:取id字段最大
select * from tablename as a
where not exists (
select 1 from tablename as b
where b.name=a.name and b.id>a.id
talename:要去重复的表
name:需要去重复的字段,可以有多个字段
ID:取id字段最大