Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: De-duplication of large table
--to delete duplicates delete highest rowid for each recnum
delete from test a
where rowid = ( select max(rowid)
from test b where b.rec_num = a.rec_num )
i would recommend doing the following first to check the duplicates for other problems
CREATE TABLE EXCEPTIONS( row_id rowid,
owner varchar2(3), table_name varchar2(30), constarintvarchar2(30))
ALTER TABLE TEST
ENABLE CONSTRAINT PK_TEST
EXCEPTIONS INTO EXCEPTIONS;
SELECT *
FROM TEST t, EXCEPTIONS e
WHERE t.rowid = x.rowid
- this will list both duplicate records and allow you to check there
contents
Dave wrote in message <811m34$na5$1_at_lure.pipex.net>...
>I have a 43,000,000 row table with about 225,000
>duplicate records.
>What is the easiest way to remove the duplicates.
>I want to remove one of every duplicate record
>from the table.
>
>Dave
>
>
>
Received on Thu Nov 18 1999 - 16:37:32 CST