Mysql
 sql >> Database >  >> RDS >> Mysql

MySQL elimina i duplicati più vecchi

Il seguente (non testato) dovrebbe funzionare:

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)