随笔分类 - MySQL
摘要:应用在使用过程中发现数据表中有一些重复记录,现需要根据 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
阅读全文

浙公网安备 33010602011771号