Wednesday, September 29, 2010

Deleting Duplicate Records form oracle table

"Write a SQL query to remove duplicate records from an Oracle table"

This is one question which I have been asked to answer this question in almost all the interviews I attended so far. The answer used to come in a flash. I used to solve this by using ROWID in a sub query. I think most of us use the same logic. Perhaps some of us would use MAX(ROWID) and some of us would use MIN(ROWID).

Recently I just had an opportunity to read the url http://www.dba-oracle.com/t_delete_duplicate_table_rows.htm. This guy has used different techniques to achieve the same. Real good stuff... So just check that out and enjoy :)