Oracle Query to remove duplicates

How would you remove duplicates from an Oracle table using a single SQL statement?

There are many query designs posssible for this. But the best according to me is this

delete from employees where rowid not in(select max(rowid) from employees group by employee_id

max(id) can be replaced by min(id)

Post a Comment

Previous Post Next Post

Contact Form