Re: Finding uniques across a big join - Mailing list pgsql-general

From Greg Stark
Subject Re: Finding uniques across a big join
Date
Msg-id 87psoghesh.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Finding uniques across a big join  ("John D. Burger" <john@mitre.org>)
Responses Re: Finding uniques across a big join
List pgsql-general
"John D. Burger" <john@mitre.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

pgsql-general by date:

Previous
From: Philippe Ferreira
Date:
Subject: Switchover : WAL archiving and shutdown...
Next
From: Tom Lane
Date:
Subject: Re: interval behaviour