how to delete duplicate rows in oracle 1

how to delete duplicate rows in oracle

DELETE FROM your_table
WHERE rowid not in
(SELECT MIN(rowid)
FROM your_table
GROUP BY column1, column2, column3);

Here is what the above code is Doing:
1. It’s selecting the minimum rowid for each group of duplicates.
2. It’s deleting all the rows that don’t have the minimum rowid.

Similar Posts