DELETE FROM 表名 WHERE (字段1,字段2,字段3) IN (SELECT 字段1,字段2,字段3 FROM (SELECT 字段1,字段2,字段3 FROM 表名 GROUP BY 字段1,字段2,字段3 HAVING COUNT(*)>1) s1) AND id NOT in (SELECT id FROM (SELECT id FROM 表名 GROUP BY 字段1,字段2,字段3 HAVING COUNT(*)>1) s2);
DELETE FROM 表名 WHERE (字段1,字段2,字段3) IN (SELECT 字段1,字段2,字段3 FROM (SELECT 字段1,字段2,字段3 FROM 表名 GROUP BY 字段1,字段2,字段3 HAVING COUNT(*)>1) s1) AND id NOT in (SELECT id FROM (SELECT id FROM 表名 GROUP BY 字段1,字段2,字段3 HAVING COUNT(*)>1) s2);