Re: avg() of array values

From: Rodrigo De León <rdeleonp(at)gmail(dot)com>
To: "Alban Hertroys" <alban(at)magproductions(dot)nl>
Cc: "Postgres General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: avg() of array values
Date: 2007-09-11 16:10:49
Message-ID: a55915760709110910x5b7df4d1r1a377284d84f21da@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9/11/07, Alban Hertroys <alban(at)magproductions(dot)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)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Phoenix Kiula 2007-09-11 16:26:51 Re: Hardware recommendation: which is best
Previous Message Franz.Rasper 2007-09-11 16:08:24 Re: Hardware recommendation: which is best