Oracle
 sql >> Database >  >> RDS >> Oracle

SQL per eliminare i duplicati in una tabella

Probabilmente sarebbe più efficiente fare qualcosa come

DELETE FROM transaction t1
 WHERE EXISTS( SELECT 1
                 FROM transaction t2
                WHERE t1.date = t2.date
                  AND t1.refnumber = t2.refnumber
                  AND t1.parentFolderId = t2.parentFolderId
                  AND t2.id > t1.id )