Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id DD648633480 for ; Mon, 18 May 2009 07:57:24 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 42645-02 for ; Mon, 18 May 2009 07:57:15 -0300 (ADT) X-Greylist: delayed 00:12:06.967121 by SQLgrey-1.7.6 Received: from fafnir.androme.com (fafnir.androme.com [62.58.96.158]) by mail.postgresql.org (Postfix) with ESMTP id A665A6323D8 for ; Mon, 18 May 2009 07:57:21 -0300 (ADT) Received: by fafnir.androme.com (Postfix, from userid 1003) id 1A890B91B4B; Mon, 18 May 2009 12:49:17 +0200 (CEST) From: =?iso-8859-1?Q?Dani_Casta=F1os?= To: Subject: SUM Array values query Date: Mon, 18 May 2009 12:49:16 +0200 Message-ID: <003f01c9d7a6$4a6d9b90$df48d2b0$@es> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcnXpknoyTtDMgxPTcKqLry29Rtj2Q== Content-Language: es X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200905/71 X-Sequence-Number: 32563 Hi all, I've this query including arrays: SELECT hour[1:5], statistics_date FROM statistics_daily WHERE statistics_date =3D to_date( '03/01/2008', 'DD/MM/YYYY' ) Result: hour | statistics_date ----------------------------+----------------- {1800,1800,1800,1800,1800} | 2008-01-03 I'm just wondering if there's some way to retrieve the hour column as = the sum of the array values... Just like this: hour | statistics_date ----------------------------+----------------- 9000 | 2008-01-03 Hour is a bigint[] array column. My version of postreSQL is 8.1.9 Thank you in advanced! P.S.: Sorry if I had send it before, but I think I was not subscribed to = the mailist. -- Dani Casta=F1os S=E1nchez dcastanos@androme.es