Re: A select DISTINCT query? - followup Q

From: johnf <jfabiani(at)yolo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: A select DISTINCT query? - followup Q
Date: 2008-01-27 19:26:23
Message-ID: 200801271126.23774.jfabiani@yolo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sunday 27 January 2008 10:56:18 am Mike Ginsburg wrote:
> Hi Phil,
> Each of columns that you specify in your SELECT clause, must also
> appear in the GROPU BY clause.
>
> SELECT COUNT(*) AS cnt, name, comment, ...
> FROM tst
> GROUP BY name, comment, ...
> HAVING COUNT(*) = 1;
>
Is the requirement of select fields matching group by fields a SQL92
requirement or something to due to Postgres? I ask because with Visual Fox
Pro I know that I can have several select fields with only one group by
field.
--
John Fabiani

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-01-27 20:23:47 Re: A select DISTINCT query? - followup Q
Previous Message Mike Ginsburg 2008-01-27 18:56:18 Re: A select DISTINCT query? - followup Q