generic crosstab ?

Поиск
Список
Период
Сортировка
От Andreas
Тема generic crosstab ?
Дата
Msg-id 4F97069B.7020303@gmx.net
обсуждение исходный текст
Ответы Re: generic crosstab ?  (Samuel Gendler <sgendler@ideasculptor.com>)
Re: generic crosstab ?  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-sql
Hi,

is there a generic solution to dump the result of a query as a crosstab, 
when I can't know how many columns I will need?

E.g. I get something like this:

id, x
1,  a
1,  b
1,  c
2,  l
2,  m


and I'd like to see it as:

id,  x1,  x2,  x3,  .....  xn
1,   a,   b,   c,    null, .... null
2,   l,    m,  ....

I fear the problem is I dont know n.


В списке pgsql-sql по дате отправления:

Предыдущее
От: Steve Crawford
Дата:
Сообщение: Re: Simple way to get missing number
Следующее
От: Samuel Gendler
Дата:
Сообщение: Re: generic crosstab ?