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

From Mark Woodward
Subject Re: Syntax bug? Group by?
Date
Msg-id 18314.24.91.171.78.1161107068.squirrel@mail.mohawksoft.com
Whole thread Raw
In response to Re: Syntax bug? Group by?  (Shane Ambler <pgsql@007Marketing.com>)
Responses Re: Syntax bug? Group by?  (Nolan Cafferky <Nolan.Cafferky@rbsinteractive.com>)
Re: Syntax bug? Group by?  (Andrew Dunstan <andrew@dunslane.net>)
Re: Syntax bug? Group by?  (Markus Schaber <schabi@logix-tt.com>)
Re: Syntax bug? Group by?  (Shane Ambler <pgsql@007Marketing.com>)
Re: Syntax bug? Group by?  ("Przemek " <krycek6@wp.pl>)
List pgsql-hackers
> Stephen Frost wrote:
>
>> select ycis_id, min(tindex), avg(tindex) from y where ycis_id = 15;
>
> But back to the query the issue comes in that the ycis_id value is
> included with the return values requested (a single row value with
> aggregate values that isn't grouped) - if ycis_id is not unique you will
> get x number of returned tuples with ycis_id=15 and the same min() and
> avg() values for each row.
> Removing the ycis_id after the select will return the aggregate values
> you want without the group by.

I still assert that there will always only be one row to this query. This
is an aggregate query, so all the rows with ycis_id = 15, will be
aggregated. Since ycis_id is the identifying part of the query, it should
not need to be grouped.

My question, is it a syntactic technicality that PostgreSQL asks for a
"group by," or a bug in the parser?


pgsql-hackers by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: Asynchronous I/O Support
Next
From: Florian Weimer
Date:
Subject: Re: Asynchronous I/O Support