crosstab function - pivot - use column value as column description - Mailing list pgsql-general

From Daniel Schuchardt
Subject crosstab function - pivot - use column value as column description
Date
Msg-id hiiluf$sv0$1@news.hub.org
Whole thread Raw
Responses Re: crosstab function - pivot - use column value as column description  (Merlin Moncure <mmoncure@gmail.com>)
Re: crosstab function - pivot - use column value as column description  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
Hy,

i'm looking for a solution to get this table dynamicaly in that resultset:

SELECT r_dbrid, r_kategorie AS column_name, r_descr AS value FROM
recnokeyword WHERE r_dbrid=X
  r_dbrid  | r_kategorie |  r_descr
----------+-------------+------------
  14725737 |material | Alu Sorte1
  14725737 |farbe | Blau
  14725737 |gewicht | 100 kg

---->

material | farbe | gewicht
----------+-------------+------------
alu sorte 1|blau | 100kg

----> the number of columns depends on data.

is there is a simple solution for that?
--

Daniel Schuchardt
/Softwareentwicklung/

/http://www.prodat-sql.de/


pgsql-general by date:

Previous
From: Omar Mehmood
Date:
Subject: Re: replication from multiple "master" servers to a single read-only slave
Next
From: Merlin Moncure
Date:
Subject: Re: crosstab function - pivot - use column value as column description