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: SQL problem

Re: SQL problem

From: Lothar Armbrüster <lothar.armbruester_at_rheingau.netsurf.de>
Date: 07 Sep 98 18:53:32 +0100
Message-ID: <785.554T1643T11333526@rheingau.netsurf.de>


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

Original text of this message

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