Re: delete duplicates, how?

From: Adam Tadjkarimi <adamt_at_hsltd.com>
Date: Fri, 12 Feb 1999 09:30:44 -0600
Message-ID: <7a1h8f$dtp$1_at_newsin-1.starnet.net>


Michael,

[Quoted] I think if the number of rows with identical values in the column(s) meant for indexing was more than
two, your script will fall short.

Thanks,
Adam Tadj
Adamt_at_hsltd.com

Opinions expressed or questions asked are mine not of my employer.

Michael Krall wrote in message <79vv71$vaf$1_at_ligarius.ultra.net>...
>
>Rune Lysbakken wrote in message <36c28c6b.388959_at_news.online.no>...
>>I want to create an unique index but I have some duplicate values. I
>>think I can find them with a combination of count, group and having
>>Count ()> 1 but how can I delete so that only one of the duplicates
>>remains? Use rowid perhaps?
>>
>>regds Rune
>Rune,
>Try something along the lines of :
>
>delete from <tablename> a
> where rowid > (select min(rowid)
> from <tablename> b
> where a.<fieldname>=b.<fieldname>);
>
>Hope this helps.
>Michael Krall
>Senior Systems Engineer
>Safety 1st
>
>
>
Received on Fri Feb 12 1999 - 16:30:44 CET

Original text of this message