Re: Eliminating duplicates

From: Mahesh Vallampati <m0v5533_at_tamsun.tamu.edu>
Date: 20 Apr 1994 16:46:33 -0500
Message-ID: <2p47rp$im5_at_tamsun.tamu.edu>


In article <patinoj.6.000D4D92_at_merlin.incae.ac.cr>, Jose Patino <patinoj_at_merlin.incae.ac.cr> wrote:
>In article <1994Apr19.215930.1228_at_rat.csc.calpoly.edu> mbhatt_at_galaxy.csc.calpoly.edu (Manish J. Bhatt) writes:
>>From: mbhatt_at_galaxy.csc.calpoly.edu (Manish J. Bhatt)
>>Subject: Eliminating duplicates
>>Date: Tue, 19 Apr 94 21:59:30 GMT
>>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.
>Try using the ROWID
> Example select rowid, column1, colum2
> from table;
>Hope this helps

Yeah u could use the rowid as in this query to delete duplicates: The sql statement is as follows:

	delete from foo t
	where not t.rowid = (select min(x.rowid) from foo x
				where x.column = t.column);

The column must be not null.
This shoud do the trick.
Hope this helps.

Thanks and Regards
Mahesh Vallampati
M.S. In EE
Dept.of Electrical Engineering,
Texas A & M University.
Ph:(409)845-6189
\\ In the Beginning there was Codd..... Received on Wed Apr 20 1994 - 23:46:33 CEST

Original text of this message