pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Lentfer <Jan.Lentfer@web.de>
To: pgsql-sql@postgresql.org
Subject: Re: Select row cells as new columns
Date: Fri, 25 May 2012 14:41:33 +0200
Message-ID: <862d618c8d42e3a0b300d1f7be966d77@neslonek.homeunix.org> (raw)
In-Reply-To: <1337936621862-5709987.post@n5.nabble.com>
References: <1337936621862-5709987.post@n5.nabble.com>

On Fri, 25 May 2012 02:03:41 -0700 (PDT), danycxxx wrote:
[...]
> The question:
> How can I achive this output?
>
> nume, prenume, cnp, nume anterior, stare civila, ... (as columns - 
> built
> from unique rows from infos)
> a      , a, .......
> b      , b, ....... (as rows)

Did you look at crosstab functions?
http://www.postgresql.org/docs/9.1/static/tablefunc.html


Jan
-- 
professional: http://www.oscar-consult.de
private: http://neslonek.homeunix.org/drupal/



view thread (4+ messages)  latest in thread

Message-ID: <862d618c8d42e3a0b300d1f7be966d77@neslonek.homeunix.org>
Permalink:  ../862d618c8d42e3a0b300d1f7be966d77@neslonek.homeunix.org/
Also on:    postgresql.org/message-id/862d618c8d42e3a0b300d1f7be966d77@neslonek.homeunix.org

 · 

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: Jan.Lentfer@web.de
  Subject: Re: Select row cells as new columns
  In-Reply-To: <862d618c8d42e3a0b300d1f7be966d77@neslonek.homeunix.org>

* 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