[Quote=引用 8 楼 tippointGmail 的回复:]
1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断
select * from people
where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)
2、删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有rowid最小的记录
delete from people
where peopleId in (select peopleId from people group by peopleId having count(…
[/Quote]
[Quote=引用 19 楼 move_stepbystep 的回复:]
引用 17 楼 move_stepbystep 的回复:
delete from tablename where id not in (select max(id) from tablename group by id,name)
不对,要把这个tablename加一个自增长字段TID
delete from tablename where TID not in (select max(TID) from tablename group by id,name)
[/Quote]
是的,19楼的方法最普遍,简单