7. November 2006 00:00

Delete duplicate records with Orcle

Don’t ask me why I needed to to that, but I had a lot (about 14 Mio.) duplicate records in a table.

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

helped me out. (thanks to www.devx.com)

Next time I write my queries to filter those out before inserting them…


Tags:  Oracle  SQL 
Comments
blog comments powered by Disqus