Re: Eliminating duplicates

From: Alexandr Pechkarev <pech_at_zgik.zaporizhzhe.ua>
Date: Fri, 22 Apr 94 08:04:50 GMT
Message-ID: <1994Apr22.080450.1280_at_zgik.zaporizhzhe.ua>


Manish J. Bhatt (mbhatt_at_galaxy.csc.calpoly.edu) wrote:
: Is there a way to remove duplicate records from a table? I did an
: import from a backup three times, and I didn't realize that each time
: it would add in another copy of a record. I can't go back to the
: backup because new data has been added since then.

  IMHO, the universal (but, probably, not effective) solution of this  problem is:

   delete from &&TABLE_NAME h1 where exists

     (select * from &&TABLE_NAME  h2  where h1.rowid=h2.rowid
     intersect
     select * from &&TABLE_NAME  h3  where h1.rowid > h3.rowid );

 With best regards

               Alexander B. Pechkaryov at pech%zgik.zaporizhzhe.ua_at_ussr.eu.net Received on Fri Apr 22 1994 - 10:04:50 CEST

Original text of this message