Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: !! URGENT - need Help !!
Mathias Dehm wrote:
>
> Hello,
>
> i have many tables in a O8-database which have duplicate entrys. This
> happens because the IMP80-tool runs twice for these tables. Until now, there
> are no constraints on this tables.
>
> An error occurs while creating an primary key because there are duplicate
> entrys.
>
> How can i delete these duplicate entrys from these tables ?
>
> Did anyone know an easy way to do this work?
>
> Thanks a lot
> Mathias
I would strongly suggest that you rename each table with a temporary name, then create the target table with the statement:
create table <table-name> as select distinct * from <temp-name>;
Then drop the temporary table and add the key constraints/indices to the target table. The main down-side to this is that you need enought space for the original table + 50%. You will need to alter the syntax of the create statement shown in order to place the table in a specific tablespace.
-Bill Boyle Received on Sat Oct 24 1998 - 22:32:01 CDT