码迷,mamicode.com
首页 > 数据库 > 详细

mysql 删除重复数据的sql语句

时间:2014-07-09 11:46:16      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:blog   数据   2014   html   htm   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语句

标签:blog   数据   2014   html   htm   sql   

原文地址:http://blog.csdn.net/terry_water/article/details/37561735

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!