From: Eric Ndengang <eric.ndengang_foyet@affinitas.de>
To: pgsql-sql@postgresql.org
Subject: How to transform table rows into Colum?
Date: Wed, 09 Mar 2011 18:16:44 +0100
Message-ID: <4D77B5FC.6010502@affinitas.de> (raw)
Hi Guys,
I have the following table:
Name Value rang salary
------------------------------------
name1 value1 1 2500
name2 value2 2 2600
name3 value 3 3 300
and want to obtain the following result:
name1 name2 name3
------------------------------------
value1 value2 value3
1 2 3
2500 2600 300
what should i do ? I read about the crosstab function in postgresql but
still have no idea on how to use it to solve this problem.
Any help would be appreciated
Regards
--
Eric Ndengang
Datenbankadministrator
Affinitas GmbH | Kohlfurter Straße 41/43 | 10999 Berlin | Germany
email: eric.ndengang_foyet@affinitas.de | tel: +49.(0)30. 991 949 5 0 | www.edarling.de
Geschäftsführer: Lukas Brosseder, David Khalil, Kai Rieke, Christian Vollmann
Eingetragen beim Amtsgericht Berlin, HRB 115958
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: eric.ndengang_foyet@affinitas.de
Subject: Re: How to transform table rows into Colum?
In-Reply-To: <4D77B5FC.6010502@affinitas.de>
* 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