根据单个字段(title)查找表中多余的重复记录
select * from article
where title in (select title from article group by title having count(title) > 1)
根据多个字段查找表中多余的重复记录
select * from article a
where (a.title,a.categoryid) in (select title,categoryid from article group by title, categoryid having count(*) > 1)
根据单个字段(title)查找并删除表中多余的重复记录,只留有rowid最小的记录
delete from article
where title in (select title from article group by title having count(title) > 1)
and rowid not in (select min(rowid) from article group by title having count(title)>1)
根据多个字段查找并删除表中多余的重复记录,只留有rowid最小的记录
delete from article a
where (a.title,a.categoryid) in (select title, categoryid from article group by title, categoryid having count(*) > 1)
and rowid not in (select min(rowid) from article group by title, categoryid having count(*)>1)