删除重复记录

删除表中多余的重复记录(多个字段),只留有rowid最小的记录
delete from vitae a
where (a.peopleId,a.seq) in  (select peopleId,seq from vitae group by peopleId,seq having count(*) > 1)
and rowid not in (select min(rowid) from vitae group by peopleId,seq having count(*)>1)

来源:

http://www.cnblogs.com/jzaileen/archive/2008/08/29/1279346.html

原文地址:https://www.cnblogs.com/meetcomet/p/2226003.html