Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL problem
On 28-Aug-98 16:25:54 Russell Fray wrote:
>Hi there,
>I have a table which contains lots of numbers in a field called
>'ag_num'. Within this field, some numbers are duplicated. I want to
>list the duplications so i can delete them at my discretion, before
>copying all data from this table in to a new table that does not allow
>duplicated in that field.
Hello Russel,
I think this will do it:
select * from your_table where ag_num in
(select ag_num from your_table
group by ag_num
having count(*)>1);
As I'm writing this at home with neither Oracle nor docs at hand, the syntax may vary slightly!
Hope that helps,
Lothar
--
Lothar Armbrüster | lothar.armbruester_at_rheingau.netsurf.de Schulstr. 12 | lothar.armbruester_at_t-online.de D-65375 Oestrich-Winkel |Received on Mon Sep 07 1998 - 12:53:32 CDT
![]() |
![]() |