Re: Finding uniques across a big join

From: Greg Stark <gsstark(at)mit(dot)edu>
To: "John D(dot) Burger" <john(at)mitre(dot)org>
Cc: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Finding uniques across a big join
Date: 2005-12-01 18:07:26
Message-ID: 87psoghesh.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"John D. Burger" <john(at)mitre(dot)org> writes:

> I don't know what that does. If you mean:
>
> select max(p2.personID), p2.eyeColor, p2.hairColor, p2.skinColor
> from persons as p2
> group by p2.personID, p2.eyeColor, p2.hairColor, p2.skinColor
> having count(*) = 1;
>
> then I don't think that works either - if I include personID in the GROUP BY,

select max(personid) as personid, eyecolor, haircolor, skincolor
from persons
group by eyecolor, haircolor, skincolor
having count(*) = 1

--
greg

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-12-01 18:08:48 Re: interval behaviour
Previous Message Philippe Ferreira 2005-12-01 18:07:02 Switchover : WAL archiving and shutdown...