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: Query to find non-unique records

Re: Query to find non-unique records

From: Phineas T. Barnham <PhineasTBarnham_at_PhineasTBarnham.com>
Date: Wed, 25 Apr 2001 22:00:18 +0100
Message-ID: <988232748.3637.0.nnrp-12.9e985e86@news.demon.co.uk>

"ewong" <ewong_at_ewong.com> wrote in message news:3AE73AAA.D72BE84_at_ewong.com...
> I have a table:
> id integer,
> tag1 varchar2(5),
> tag2 varchar2(5),
> text clob
> ...
>
> The primary key is (id,tag1,tag2). I disabled the pk couple days ago
> and find that I am not able to enable it anymore because some new
> records don't have unique pks on the three columns. How can I do query
> to track down those non-unique records?
>
> Thanks.
>

select id,tag1,tag2
from my_table
group by id,tag1,tag2
having count(*) > 1 Received on Wed Apr 25 2001 - 16:00:18 CDT

Original text of this message

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