Search Postgresql Archives

Re: avg() of array values

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

 



On 9/11/07, Alban Hertroys <alban@xxxxxxxxxxxxxxxxx> wrote:
> I would have expected an avg of 2.0 and a sum of 4, where am I going wrong?

This works for me:

select avg(a) from explode_array(array[1, 3]) a;

        avg
--------------------
 2.0000000000000000
(1 row)

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[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