Search Postgresql Archives

Re: avg() of array values

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

 



On Tue, Sep 11, 2007 at 05:50:38PM +0200, Alban Hertroys wrote:
> *> select avg(*) from explode_array(array[1, 3]);
>           avg
> ------------------------
>  1.00000000000000000000
> (1 row)

avg(*) is not valid, same for sum(*) the reaosn you get the answer you
do it because postgres replaces the * with a 1, whic doesn't change the
fact that the query is wrong.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment: signature.asc
Description: Digital signature


[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