标签:sele 重复数 key ice 字段 and count 假设 sig
同一张表中,假设以两个字段做唯一业务,这两个字段分别为key1,key2,
则以这两个字段为唯一
DELETE tablename FROM t_price_insignt_profit , ( SELECT min(id) id, key1, key2 FROM tablename GROUP BY key1, key2 HAVING count(*) > 1 ) t2 WHERE tablename .key1=t2.key1 AND tablename .key2=t2.key2 AND tablename .id > t2.id;
标签:sele 重复数 key ice 字段 and count 假设 sig
原文地址:https://www.cnblogs.com/stevenlii/p/11671005.html