I use the following queries to delete duplicate rows:
$dbh->do( "ALTER IGNORE TABLE data ADD UNIQUE INDEX dupidx ( field1, field2, field3, field4 )" );
$dbh->do( "ALTER TABLE leads DROP INDEX dupidx" );
However, this way it preserves the oldest entry and deletes the following rows with same data. IS there a way to delete the old one and keep the newest row of the duplicates?