Re: duplicates

From: Ms. D.H. Harvey <qq45_at_liverpool.ac.uk>
Date: 1995/08/01
Message-ID: <DCMwx9.8ow_at_liverpool.ac.uk>#1/1


Try something like

	select * from mytable m1
	where rowid > (select min (rowid)
		       from mytable m2
		       where m1.fld1 = m2.fld1
			 and m1.fld2 = m2.fld2

.
.
and m1.fldn = m2.fldn)

Fields tested for equivalence those for which wish to create unique index.

Before running this on a large table, best to create the index you originally tried to, but as non-unique rather than unique. Speed things up somewhat.

If you do not care which duplicate you remove, just change first line to

        delete from mytable m1

Hope this helps?

        Helen Received on Tue Aug 01 1995 - 00:00:00 CEST

Original text of this message