Extracting data from arrays - Mailing list pgsql-sql

From Dani Castaños
Subject Extracting data from arrays
Date
Msg-id 003b01c9d7a5$b7b22190$271664b0$@es
Whole thread Raw
Responses Re: Extracting data from arrays
List pgsql-sql
Hi all,

I've this query including arrays:

SELECT hour[1:5], statistics_date FROM statistics_dailyWHERE statistics_date = 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!

--
Dani Castaños Sánchez
dcastanos@androme.es




pgsql-sql by date:

Previous
From: Dani Castaños
Date:
Subject: SUM Array values query
Next
From: Pavel Stehule
Date:
Subject: Re: Extracting data from arrays