Re: Find out duplicate keys

From: Michel Lalonde <michel.lalonde_at_sit.ulaval.ca>
Date: 1996/04/09
Message-ID: <michel.lalonde.68.000A7E5B_at_sit.ulaval.ca>#1/1


In article <4k8i2k$qs_at_amanda.dorsai.org> vkwan_at_dorsai.org (Vito Kwan) writes:
>From: vkwan_at_dorsai.org (Vito Kwan)
>Subject: Find out duplicate keys
>Date: 7 Apr 1996 10:05:08 -0400
 

>Hi all,
> I wonder if there is a easier way to delete the rows with duplicate
>keys (including single PK and composite PKs) without using resursion or
>alias of the table.
> Thanks for your help.
 

>Vito Kwan
>vkwan_at_dorsai.org
 

>--
>Vito Kwan
>vkwan_at_dorsai.org
>======================================================================
>I am Sir Oracle, And when I ope my lips, let no dog bark!
> Shakespeare: The Merchant of Venice

Enable the PK with the EXCEPTIONS clause. The rowids of the duplicate will be in the exceptions table. Then you:

delete from the_table
where rowid in (select row_id from exeptions_table);

Miclel Lalonde Received on Tue Apr 09 1996 - 00:00:00 CEST

Original text of this message