Re: [GENERAL] Selecting duplicates - Mailing list pgsql-general

From Yury Don
Subject Re: [GENERAL] Selecting duplicates
Date
Msg-id 37AA9A8C.6AD691F5@vpcit.ru
Whole thread Raw
In response to Selecting duplicates  (ghoffman@ucsd.edu (Gary Hoffman))
List pgsql-general
Hi Garry

Perhaps following will help you (asuming that "id" is your soon-to-be
primary key):

select oid, id from tab a where exists
(select oid from tab b where b.id=a.id and b.oid<>a.oid)
order by id

Sincerely yours, Yury.
don.web-page.net, ICQ 11831432

Gary Hoffman wrote:
>
> Somehow, I've managed to get duplicate entries in my soon-to-be primary
> key field. How can I select for duplicates in a field? I know how to
> select for blank and NULL, but duplicates escape me.
>
> Thanks,
> Gary

pgsql-general by date:

Previous
From: Vadim Mikheev
Date:
Subject: Re: [GENERAL] Selecting duplicates
Next
From: Herbert Liechti
Date:
Subject: Re: [GENERAL] Selecting duplicates