Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Query to find non-unique records
Try this.
SELECT COUNT(*), id,tag1,tag2
FROM table
GROUP BY id,tag1,tag2
HAVING COUNT(*)>1;
"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.
>
Received on Thu Apr 26 2001 - 05:29:05 CDT