Unanswered: How can i delete duplicate rows from my table?
I had a segmentation fault in the middle of loading huge amounts of data into Oracle and i had to start putting the file of data into the database again. As a result there are some duplicate rows in my table which i'd like to get rid of. I really don't want to scrap everything and start loading the files of data in again so can any one give me suggestions as to how to get rid of these duplicates??
Here's an example ... Concatenate the primary key of the table to the rowid .... I always do a select first ... You can create a table as select
to get all dups in a temporary table, review them, then delete the
main table from the rowids ...
/* Always SELECT before attempting to DELETE !!! */
SELECT * FROM loader_physician_recs
WHERE physician_id||rowid IN
FROM loader_physician_recs a, loader_physician_recs b
WHERE a.physician_id = b.physician_id
AND a.rowid < b.rowid);