Re: Find out duplicate keys
From: Ken Denny <kedenny_at_mail.concentric.net>
Date: 1996/04/08
Message-ID: <4kbtur$s7o_at_tribune.concentric.net>#1/1
Date: 1996/04/08
Message-ID: <4kbtur$s7o_at_tribune.concentric.net>#1/1
vkwan_at_dorsai.org (Vito Kwan) wrote:
>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
>
Another possibility:
delete from tablex t where 0 <
(select count(*) from tablex where key = t.key
and rowid != t.rowid);
Ken Denny
-- /| / / | / _ _ |< / \ /|/ \ | \ \ / / | \ | \__X___/ | \___Received on Mon Apr 08 1996 - 00:00:00 CEST