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

Posted on 2021-08-19 13:44  黔人阿诺  阅读(165)  评论(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

)