Re: Grouping aggregate functions - Mailing list pgsql-general

From Kai Hessing
Subject Re: Grouping aggregate functions
Date
Msg-id 49fbcaFo7lnfU1@individual.net
Whole thread Raw
In response to Re: Grouping aggregate functions  (Richard Connamacher <rich.n1@indieimage.com>)
List pgsql-general
Richard Connamacher wrote:
> This came up with an error too, but it pointed me in the right
> direction and was easy to fix. I needed to use an alias for the
> entire subquery too, so what finally worked is this:
>
> SELECT avg(minprice) FROM
>     (SELECT min(price) AS minprice FROM weekly_supply_prices GROUP BY
> month) AS minprice_table;

Interesting, but you're right ;) Btw. if you want you may skip the 'AS'.
Just 'SELECT ... FROM (....) mt;

pgsql-general by date:

Previous
From: "patrick"
Date:
Subject: Re: recover from base directory?
Next
From: Tom Lane
Date:
Subject: Re: recover from base directory?