如何批量删除mysql表中某个字段重复的所有数据

发布者: xiaozhimn

如何批量删除mysql表中某个字段重复的所有数据

DELETE FROM crawler_artical WHERE title IN ( SELECT title FROM ( SELECT title FROM crawler_artical GROUP BY title HAVING count(title) > 1 ) a ) AND id NOT IN ( SELECT min(cid) FROM ( SELECT min(id) AS cid FROM crawler_artical GROUP BY title HAVING count(title) > 1 ) b);
0赞