Search Postgresql Archives

Re: Grouping aggregate functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux