Re: duplicates

From: Chuck Hamilton <chuckh_at_ix.netcom.com>
Date: 1995/08/01
Message-ID: <3vlbq4$8i2_at_ixnews6.ix.netcom.com>#1/1


In <1995Aug1.115212.57550_at_ucl.ac.uk> ucfaabe_at_ucl.ac.uk (Mr Angus Beare) writes:
>
>
>I have a table that I want to create a unique index for
>but I can't because of duplicates. Oracle won't tell
>me where they are.
>
>Does anyone know a quick way to find duplicate records?
>
>thanks for any suggestions
>
>Gus
>
>--
>Angus Beare

Assuming the table name is 'mytable' and the column in questions is called 'id', try the following...

SELECT id, count(id) "Duplicates"
FROM mytable
GROUP BY id
HAVING count(id) > 1;

-- 
Chuck Hamilton
chuckh_at_ix.netcom.com

Incoming fire has the right of way!
Received on Tue Aug 01 1995 - 00:00:00 CEST

Original text of this message