Mysql
 sql >> Datenbank >  >> RDS >> Mysql

Mysql löscht ältere Duplikate

Folgendes (ungetestet) sollte funktionieren:

DELETE FROM someTable WHERE EXISTS ( SELECT id FROM someTable AS subqTable WHERE
subqTable.id = someTable.id
AND subqTable.ean = someTable.ean
-- and other equality comparisons
AND subqTable.date AFTER someTable.date)