Re: Identify duplicate keys

From: Devan F. Dewey <dewey_at_centerline.com>
Date: 30 Mar 1993 20:39:23 GMT
Message-ID: <dewey-300393155352_at_sebastian.centerline.com>


In article <C4o9C6.8AC_at_da_vinci.it.uswc.uswest.com>, Jeffrey L. DeMent <jld_at_advtech.uswest.com> wrote:
>
> Trying to create an index on an Oracle V6 table -- but it's failing
> because of duplicate keys. Is there a slick/fast/easy way to identify
> the rows with duplicate keys (for subsequent deleting !) ?

You could try:

                select count(*), key from table
  group by key
  minus
  select 1, key from table

This will also tell you how many there are.

>
> Thanks.

                             
               Devan F. Dewey | Senior Systems Analyst
          CenterLine Software | dewey_at_centerline.com
            10 Fawcett Street | "Leme esplain - no dere is
          Cambridge, MA 02138 | too much. Leme sum up."
                                       -Inigo Montoya
Received on Tue Mar 30 1993 - 22:39:23 CEST

Original text of this message