-
Use
any
DELETE FROM table_name a WHERE a.rowid > ANY ( SELECT b.rowid FROM table_name b WHERE a.col1 = b.col1 AND a.col2 = b.col2 ) ;
-
Use
NOT IN
andMIN
DELETE FROM table_name a WHERE a.rowid NOT IN ( SELECT MIN(b.rowid) FROM table_name b GROUP BY col1, col2 ) ;