Re: Eliminating duplicates

From: DRathbun <drathbun_at_aol.com>
Date: 25 Apr 1994 21:29:07 -0400
Message-ID: <2phqp3$g95_at_search01.news.aol.com>


In article <1994Apr22.080450.1280_at_zgik.zaporizhzhe.ua>, pech_at_zgik.zaporizhzhe.ua (Alexandr Pechkarev) writes:

<< in respose to>>
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.

How about:

Create table newtable
as
select distinct (field1, field2, field3... fieldn) from oldtable
/
drop oldtable
/
rename newtable to oldtable
/
This is an easy enough trick to use, and also releases the free space used by the extra rows added in the original table; the resulting newtable is only as
large as allocated (or needed to hold the data).

Regards,

Dave Rathbun Received on Tue Apr 26 1994 - 03:29:07 CEST

Original text of this message