Delete duplicate record from oracle table

you must use the rowid column to delete the duplicate record

delete from table_name
where rowid not in (
select min(rowid) from table_name group by c1,c2,c3
)

e.g:
delete from employees
where rowid not in (
select min(rowid) from employees group by employee_id, first_name,last_name
)

Leave a Reply

Your email address will not be published. Required fields are marked *

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top