Re: crosstab function - pivot - use column value as column description

Поиск
Список
Период
Сортировка
Искать
От
Merlin Moncure
Тема
Re: crosstab function - pivot - use column value as column description
Дата
Msg-id
b42b73151001121300t742b9889xbac8b68323d39476@mail.gmail.com
Ответ на
Список
Дерево обсуждения
crosstab function - pivot - use column value as column description Daniel Schuchardt <d.schuchardt@prodat-sql.de>
Re: crosstab function - pivot - use column value as column description Pavel Stehule <pavel.stehule@gmail.com>
Re: crosstab function - pivot - use column value as column description Pavel Stehule <pavel.stehule@gmail.com>
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 Daniel Schuchardt <d.schuchardt@prodat-sql.de>
On Tue, Jan 12, 2010 at 3:27 PM, Daniel Schuchardt
 wrote:
> 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?

have you ruled out the appropriate contrib module?

http://www.postgresql.org/docs/8.4/static/tablefunc.html

merlin
В списке pgsql-general по дате отправления
От: Daniel Schuchardt
Дата:
От: Erik Jones
Дата:
FAQ