Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Finding Duplicates in a table

Re: Finding Duplicates in a table

From: Ronen Shachar <ronen_at_buywiz.com>
Date: Thu, 24 Jun 1999 15:28:18 +0200
Message-ID: <7kt83n$chj$1@news2.inter.net.il>

<smfrank_at_my-deja.com> wrote in message news:7ks4f3$ove$1_at_nnrp1.deja.com...
> Could some one please provide me with a SQL statement that
> will allow me to list duplicate(non-distinct) records in a table?
>
> Thanks in advance!!
>
> SF
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

Use next sql stetment:

    select count(*), my_field
    group by my_field
    having count(*)>1;

This will give you all records that have more than one distinct value in my_field.

Note: you cant select fields not in the group by field list.

Ronen Shachar. Received on Thu Jun 24 1999 - 08:28:18 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US