Remove duplicate rows in Oracle

How to delete all duplicate rows and leave only one of them, in Oracle?

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

Where column1, column2, etc. is the key you want to use.

Relative links:

Remove duplicate rows in MySQL

Remove duplicate rows in SQL Server

Some Oracle tools you can try: https://www.withdata.com/oracle/

Convert your data online, free

Free in-browser converters for CSV, Excel, JSON, XML and SQL: Withdata Online Data Conversion. Large files, batch conversion or scheduling? See the offline desktop apps, or browse all data conversion tools.


Posted

in

by