Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Finding Duplicates in a table
<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