Delete Duplicate Rows From an Oracle Table
Yesterday i was loading data into tables, some how i messed up loading the same data two times.
Here is a solution how to remove duplicate rows:
DELETE FROM THE_TABLE
WHERE rowid not in
(SELECT MIN(rowid)
FROM our_table
GROUP BY COL1, COL2, COL3… ) ;
Here COL1, COL2, COL3 constitute the identifying key for each record.
The GROUP BY is used on the columns that make the primary key for the table. This script deletes each row in the group after the first row.







