Average of Array?

From: Lee Hachadoorian <lee(dot)hachadoorian(at)gmail(dot)com>
To: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Average of Array?
Date: 2010-06-25 16:21:01
Message-ID: AANLkTimbLPhLW7DzeTugvwClKBX-UQhOrUlR8afHydGB@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Is there a function that returns the average of the elements of an
array? I'm thinking of something that would work like the avg()
aggregate function where it returns the average of all non-NULL
values. Can't find anything like it in the docs, and I'd like to make
sure I'm not missing something.

Thanks,

--
Lee Hachadoorian
PhD Student, Geography
Program in Earth & Environmental Sciences
CUNY Graduate Center

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2010-06-25 16:29:00 Re: Average of Array?
Previous Message Gerardo Herzig 2010-06-24 22:26:14 differences between function returning 'setof table' and 'table'