Re: [GENERAL] Selecting duplicates

From: Yury Don <yura(at)vpcit(dot)ru>
To: Gary Hoffman <ghoffman(at)ucsd(dot)edu>
Cc: pgsql-general(at)hub(dot)org
Subject: Re: [GENERAL] Selecting duplicates
Date: 1999-08-06 08:19:24
Message-ID: 37AA9A8C.6AD691F5@vpcit.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Herbert Liechti 1999-08-06 08:46:34 Re: [GENERAL] Selecting duplicates
Previous Message Vadim Mikheev 1999-08-06 08:15:31 Re: [GENERAL] Selecting duplicates