mysql删除重复数据只保留一条

Posted on 2021-08-19 13:44  黔人阿诺  阅读(160)  评论(0编辑  收藏  举报
delete from toutiao where title in (SELECT a.title from

(select title from toutiao group by title

having count(title) > 1) a

)and id not in (SELECT b.id from (select id from toutiao group by title having count(title) > 1) b

)