Re: pivot functions with variable number of columns

Поиск
Список
Период
Сортировка
От Chris Travers
Тема Re: pivot functions with variable number of columns
Дата
Msg-id CAKt_Zft5CsGQvr05p-LkEOTAraJYO5fuvT=Q=G87TTrKou2YZA@mail.gmail.com
обсуждение исходный текст
Ответ на pivot functions with variable number of columns  (punnoose <punnoose.pj@dwisesolutions.com>)
Ответы Re: pivot functions with variable number of columns  (Vincent Veyron <vv.lists@wanadoo.fr>)
Список pgsql-general


On Wed, Sep 5, 2012 at 10:14 PM, punnoose <punnoose.pj@dwisesolutions.com> wrote:
I want to have a pivot like function in which i should have variable number
of columns.i went for crosstab but it doesnot support variable number of
columns.Can any body suggest an alternative.like if i have a event at a
particular time of the day like one at 02:35,11:34, then i should have
column name 02:35,11:34.

You could detect the columns you want to return and use a plpgsql function that returns a refcursor, I suppose.

Best Wishes,
Chris travers 

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

Предыдущее
От: Raghavendra
Дата:
Сообщение: Re: pivot functions with variable number of columns
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: Moving several databases into one database with several schemas