Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 0C320632C3B for ; Fri, 25 Jun 2010 13:21:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 02853-01 for ; Fri, 25 Jun 2010 16:21:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f46.google.com (mail-bw0-f46.google.com [209.85.214.46]) by mail.postgresql.org (Postfix) with ESMTP id A261F632A99 for ; Fri, 25 Jun 2010 13:21:03 -0300 (ADT) Received: by bwz7 with SMTP id 7so780048bwz.19 for ; Fri, 25 Jun 2010 09:21:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=nxNxL/DbeKrcVuTTYxU5dRdrPYGVl875YpnlqkzwNx8=; b=mgzXeq3+MnOFqoCQNcpjzJsV3dOa5x6Qcn569OcU+tFbcM7ZASMPe293odBdA5yZuv 1kxzjFN90x2vX++kOdqC2TKL2aGybBhf61xsgSTh+vLU0Br21q9CVOiAQCnvKg9UajBI wB201cETT9Ub5k0J0lb8mJSierYPsLtNkdW4E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=mx9VaP3e+2SRFcrwFkFJND9GEdYZCLnEW4IlkRf7t4k2NGN3v6enPnTUvJ8VOodKPl tSgDhertotP/7t6PL1AYtFwFNHgYsS/ceOUrCIFEAeuhdf0qlxbopCMqzH7X0sN5I1SE 9uGFN2chIqFFm+CFd7w/hJ9hnBYdrcurEYzJs= MIME-Version: 1.0 Received: by 10.204.73.193 with SMTP id r1mr685580bkj.111.1277482862081; Fri, 25 Jun 2010 09:21:02 -0700 (PDT) Received: by 10.204.101.5 with HTTP; Fri, 25 Jun 2010 09:21:01 -0700 (PDT) Date: Fri, 25 Jun 2010 12:21:01 -0400 Message-ID: Subject: Average of Array? From: Lee Hachadoorian To: pgsql-sql Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.8 tagged_above=-5 required=5 tests=BAYES_50=0.8 X-Spam-Level: X-Archive-Number: 201006/87 X-Sequence-Number: 34278 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