pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lee Hachadoorian <lee.hachadoorian@gmail.com>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Average of Array?
Date: Fri, 25 Jun 2010 12:21:01 -0400
Message-ID: <AANLkTimbLPhLW7DzeTugvwClKBX-UQhOrUlR8afHydGB@mail.gmail.com> (raw)

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



view thread (5+ messages)  latest in thread

Message-ID: <AANLkTimbLPhLW7DzeTugvwClKBX-UQhOrUlR8afHydGB@mail.gmail.com>
Permalink:  ../AANLkTimbLPhLW7DzeTugvwClKBX-UQhOrUlR8afHydGB@mail.gmail.com/
Also on:    postgresql.org/message-id/AANLkTimbLPhLW7DzeTugvwClKBX-UQhOrUlR8afHydGB@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lee.hachadoorian@gmail.com
  Subject: Re: Average of Array?
  In-Reply-To: <AANLkTimbLPhLW7DzeTugvwClKBX-UQhOrUlR8afHydGB@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox