Re: Grouping aggregate functions

From: Kai Hessing <kai(dot)hessing(at)hobsons(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Grouping aggregate functions
Date: 2006-04-04 13:41:30
Message-ID: 49fbcaFo7lnfU1@individual.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-04-04 13:52:52 Re: recover from base directory?
Previous Message patrick 2006-04-04 13:40:49 Re: recover from base directory?