DELETE FROM TABLE_NAME A WHERE (A.FIELD1, A.FIELD2) IN (SELECT FIELD1, FIELD2 FROM TABLE_NAME GROUP BY FIELD1, FIELD2 HAVING COUNT(*) > 1) AND ROWID NOT IN (SELECT MIN(ROWID) FROM TABLE_NAME GROUP BY FIELD1, FIELD2 HAVING COUNT(*) > 1);
2021-11-28 16:24:20
DELETE FROM TABLE_NAME A WHERE (A.FIELD1, A.FIELD2) IN (SELECT FIELD1, FIELD2 FROM TABLE_NAME GROUP BY FIELD1, FIELD2 HAVING COUNT(*) > 1) AND ROWID NOT IN (SELECT MIN(ROWID) FROM TABLE_NAME GROUP BY FIELD1, FIELD2 HAVING COUNT(*) > 1);