SQL删除表中多餘的重複記錄(多個字段都是重複的)
delete from user a
where (a.id,a.name) in (select id,name from user group by id,name having count(*) > 1)
and id not in (select min(id) from user group by id,name having count(*)>1)
隻留有rowid最小或者最大的記錄,其餘的均删除。