mysql 删除重复数据的sql语句

CREATE TABLE tmp AS SELECT id FROM get_review_url  WHERE (no,title,name,content) IN (SELECT no,title,name,content FROM get_review_url GROUP BY no,title,name,content HAVING 

COUNT(*) > 1) AND id NOT IN (SELECT MIN(id) FROM get_review_url GROUP BY no,title,name,content HAVING COUNT(*)>1);
DELETE FROM get_review_url WHERE id IN (SELECT id FROM tmp);
DROP TABLE tmp;

mysql 删除重复数据的sql语句,布布扣,bubuko.com

mysql 删除重复数据的sql语句

上一篇:将数据库中的数字显示为文字


下一篇:SQL用子查询结果更新多个字段