pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sean Davis <sdavis2@mail.nih.gov>
To: Thomas Borg Salling <tbs@navicon.dk>
To: pgsql-sql@postgresql.org
Subject: Re: "Flattening" query result into columns
Date: Mon, 21 Mar 2005 18:27:41 -0500
Message-ID: <002d01c52e6d$93e02360$1f6df345@WATSON> (raw)
References: <20050321215723.E79E356388@svr1.postgresql.org>

Thomas,

You probably want a crosstab.  There is a contributed module in contrib/crosstab.  If you do a search of the postgres mailing lists, there will be several posts relating to the same issue.

Sean

  ----- Original Message ----- 
  From: Thomas Borg Salling 
  To: pgsql-sql@postgresql.org 
  Sent: Monday, March 21, 2005 4:57 PM
  Subject: [SQL] "Flattening" query result into columns


  I am looking for a way to "flatten" a query result, so that rows are "transposed" into columns, just as asked here for oracle:

  http://groups.google.dk/groups?hl=da&lr=&client=firefox-a&rls=org.mozilla:en-US:official...

   

  Is there any way to do this with pgsql  ?

   

  Thanks,

  /Thomas.

   

   

view thread (7+ messages)  latest in thread

Message-ID: <002d01c52e6d$93e02360$1f6df345@WATSON>
Permalink:  ../002d01c52e6d$93e02360$1f6df345@WATSON/
Also on:    postgresql.org/message-id/002d01c52e6d$93e02360$1f6df345@WATSON

 · 

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: sdavis2@mail.nih.gov, tbs@navicon.dk
  Subject: Re: "Flattening" query result into columns
  In-Reply-To: <002d01c52e6d$93e02360$1f6df345@WATSON>

* 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