Advice returning data as an array

From: George Woodring <george(dot)woodring(at)iglass(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Advice returning data as an array
Date: 2009-08-20 12:07:15
Message-ID: cfbfcf160908200507q422601c2r3950f5db8a102587@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have the following query that works the way I need:
SELECT '20090812' AS date, sum(in_oct) AS bytes, sum(in_pkt) AS pkts, 'appl'
AS name, ARRAY['appl'] AS fields, CAST((LEAST(src_port, dst_port)) AS
varchar) as fieldVal FROM flow_history.flows_20090812 GROUP BY fieldVal
ORDER BY bytes DESC LIMIT 20;

My issue is that I need to get the fieldVal to return as an array and be
fieldVal[1]. Any suggestions?

Thanks,
Woody

--
iGLASS Networks
www.iglass.net

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Gerardo Herzig 2009-08-20 15:17:38 using case to select 'which version to use'
Previous Message Jasen Betts 2009-08-20 10:51:13 Re: Updating one table with data from another