Re: [SQL] Duplicate rows

From: Bruce Stephens <bruce(at)cenderis(dot)demon(dot)co(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] Duplicate rows
Date: 1998-05-16 14:02:11
Message-ID: m3wwbme2l8.fsf@cenderis.demon.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Andy Lewis <alewis(at)mpsi(dot)net> writes:

> Right, I know that there are dups in the column. But, I don't know
> where they are nor do I know their value(s). I want to be able to
> find, say, two interger values that are in the same column but,
> different rows.

How about

SELECT t1.col,t1.oid, t2.oid FROM fred AS t1, fred AS t2
WHERE t1.col=t2.col AND t1.oid<t2.oid

(I haven't tested this, but it's the right kind of idea: select the
interesting bits from a self-join.)

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Oleg Broytmann 1998-05-16 14:06:06 Re: [SQL] Duplicate rows
Previous Message Andy Lewis 1998-05-16 13:18:05 Re: [SQL] Duplicate rows