Re: avg() of array values - Mailing list pgsql-general

From Rodrigo De León
Subject Re: avg() of array values
Date
Msg-id a55915760709110910x5b7df4d1r1a377284d84f21da@mail.gmail.com
Whole thread Raw
In response to avg() of array values  (Alban Hertroys <alban@magproductions.nl>)
List pgsql-general
On 9/11/07, Alban Hertroys <alban@magproductions.nl> 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)

pgsql-general by date:

Previous
From: Franz.Rasper@izb.de
Date:
Subject: Re: Hardware recommendation: which is best
Next
From: Andreas Kretschmer
Date:
Subject: Re: creating/dropping tables inside functions?