Re: Select row cells as new columns

From: Jan Lentfer <Jan(dot)Lentfer(at)web(dot)de>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Select row cells as new columns
Date: 2012-05-25 12:41:33
Message-ID: 862d618c8d42e3a0b300d1f7be966d77@neslonek.homeunix.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Lentfer 2012-05-25 12:52:43 Re: Job control in sql
Previous Message danycxxx 2012-05-25 09:03:41 Select row cells as new columns