mysql 删除表中多余的重复记录(多个字段),只留有id最小的记录
DELETE FROM 表1 f WHERE
(f.字段1,f.字段2) IN ( SELECT 字段1,字段2 FROM 表1 GROUP BY 字段1,字段2 HAVING count(*) > 1 )
AND id NOT IN ( SELECT min(id) FROM 表1 GROUP BY 字段1,字段2 HAVING count(*) > 1 )
标签:留有,java,mysql,字段,表中,重复记录,id
From: https://www.cnblogs.com/dawndefend/p/16652035.html