pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: George Woodring <george.woodring@iglass.net>
To: pgsql-sql@postgresql.org
Subject: Advice returning data as an array
Date: Thu, 20 Aug 2009 08:07:15 -0400
Message-ID: <cfbfcf160908200507q422601c2r3950f5db8a102587@mail.gmail.com> (raw)

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

view thread (2+ messages)  latest in thread

Message-ID: <cfbfcf160908200507q422601c2r3950f5db8a102587@mail.gmail.com>
Permalink:  ../cfbfcf160908200507q422601c2r3950f5db8a102587@mail.gmail.com/
Also on:    postgresql.org/message-id/cfbfcf160908200507q422601c2r3950f5db8a102587@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: george.woodring@iglass.net
  Subject: Re: Advice returning data as an array
  In-Reply-To: <cfbfcf160908200507q422601c2r3950f5db8a102587@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