Re: Syntax bug? Group by? - Mailing list pgsql-hackers

From Mark Woodward
Subject Re: Syntax bug? Group by?
Date
Msg-id 18196.24.91.171.78.1161110259.squirrel@mail.mohawksoft.com
Whole thread Raw
In response to Re: Syntax bug? Group by?  (Markus Schaber <schabi@logix-tt.com>)
Responses Re: Syntax bug? Group by?  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
> Hi, Mark,
>
> Mark Woodward wrote:
>> Shouldn't this work?
>>
>> select ycis_id, min(tindex), avg(tindex) from y where ycis_id = 15;
>>
>> ERROR:  column "y.ycis_id" must appear in the GROUP BY clause or be used
>> in an aggregate function
>>
>> If I am asking for a specific column value, should I, technically
>> speaking, need to group by that column?
>
> Try:
>
> SELECT 15 as ycis_id, min(tindex), avt(tindex) from y where ycis_id = 15;
>
>
This isn't a "SQL" question!!! This is a question of whether or not
PostgreSQL is correct in requiring a "group by" in the query. I assert
that since it is unabiguous as to what "ycis_id" should be, PostgreSQL
should not require a grouping.


pgsql-hackers by date:

Previous
From: "Raja Agrawal"
Date:
Subject: Re: Asynchronous I/O Support
Next
From: "Mark Woodward"
Date:
Subject: Re: Syntax bug? Group by?