一、单表中数据去重
将重复的:user_code,user_name 的记录去掉
delete * from user WHERE del_flag = '0' and id NOT IN ( SELECT MIN(id) AS id FROM user where del_flag = '0' GROUP BY user_code,user_name ) )
原数据:
xxx, 小三,123123,123123,123,123,123
xxx, 小五,213123,12313,1232,123,234
xxx, 小六,123123,123123,123,123,123
xxx, 小三,123123,123123,123,123,123
xxx, 小六,123123,123123,123,123,123
结果:
xxx, 小三,123123,123123,123,123,123
xxx, 小五,213123,12313,1232,123,234
xxx, 小六,123123,123123,123,123,123