
数据库
lfp0202
学习java的过程中
展开
-
查询及删除重复记录的方法
<br />查询及删除重复记录的方法<br />(一)<br />1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断<br />select * from people<br />where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)<br /><br />2、删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留转载 2010-10-27 17:31:00 · 226 阅读 · 0 评论 -
删除表中重复的数据,其中某列数据相同
<br /><br />INSERT INTO t_info_whitelist_copy<br />SELECT *,count(distinct telephone) FROM `t_info_whitelist` group by telephone;<br /> <br /> <br />insert into t_info_whitelist select * from t_info_whitelist_copy;原创 2010-11-05 14:30:00 · 287 阅读 · 0 评论