摘要:
应用在使用过程中发现数据表中有一些重复记录,现需要根据 taobao_nick, taobao_id 来过滤出重复记录并删除,保留其中一条记录即可。1. 首先使用查询语句检查一下重复记录数select taobao_nick, taobao_id, count(*) from user group by taobao_nick, taobao_id having count(*) > 1;2. 使用以下语句删除数据 DB2和Oracle:delete from user where id in (select max(ID) as id from user group by taobao 阅读全文
posted @ 2012-06-29 11:48
esky2000
阅读(563)
评论(0)
推荐(0)

浙公网安备 33010602011771号