Re: Select row cells as new columns - Mailing list pgsql-sql

From Jan Lentfer
Subject Re: Select row cells as new columns
Date
Msg-id 862d618c8d42e3a0b300d1f7be966d77@neslonek.homeunix.org
Whole thread Raw
In response to Select row cells as new columns  (danycxxx <danycxxx@yahoo.com>)
Responses Re: Select row cells as new columns
List pgsql-sql
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/


pgsql-sql by date:

Previous
From: danycxxx
Date:
Subject: Select row cells as new columns
Next
From: Jan Lentfer
Date:
Subject: Re: Job control in sql