Re: Remove duplicate data in Oracle DB

From: <gmei_at_my-deja.com>
Date: 2000/02/15
Message-ID: <88cajt$sgb$1_at_nnrp1.deja.com>#1/1


In article <38A8FEA1.35D33056_at_email.sps.mot.com>,   N.Hadi_at_motorola.com wrote:
> I have tables in Oracle database which I could not enforce primary key
> due to unavoidable situation. Because of this, I might see
 duplications
> of data row.
>
> I want to know if it is possible for me to remove the duplicate row
 (s)?
> Appreciate any reply, reference or any tool that I could use to
 overcome
> this situation.
>
> Thanks in advance.
>

I don't know if there is any tool for this, you may need to do this manally. Here is what I will do in sqlplus or sql worksheet:

1.Create a temp table with the same column structure as the orginal table

2. Insert into temp table
Select distinct Primary Key Column ,

       and all other clomn
from orginal table

3. delete old data from orginal table

4. copy data back from temp table to orginal table

5. drop the temp table

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Feb 15 2000 - 00:00:00 CET

Original text of this message