Re: dynamic crosstab

Поиск
Список
Период
Сортировка
От Balázs Klein
Тема Re: dynamic crosstab
Дата
Msg-id 20080215122937.CF8F4136C7A@mail01a.mail.t-online.hu
обсуждение исходный текст
Ответ на Re: dynamic crosstab  (Erik Jones <erik@myemma.com>)
Ответы Re: dynamic crosstab
Список pgsql-general
Erik Jones wrote:
> First, please stop top-posting.  It makes it difficult for both me
> and others to know to whom/what you are replying.

Sorry, I don't know much about mailing list customs - I had to look up what top-posting is. I will behave now ...

I would prefer to keep the complications for when I retrieve the data rather then when I store it.

I could imagine something like this though to create a crosstab as an array, but I am afraid that there is no assurance
thatthe resulting array would contain the values in the same order for each focus: 

tbl(eID, aID, value)

Select eID, array_accum(value) from
(
 (Select Distinct eID from tbl) e
  CROSS JOIN
 (Select Distinct aID from tbl) a
) ea
 LEFT OUTER JOIN
tbl USING (eID, aID)
GROUP BY eID

B.


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

Предыдущее
От: "Phoenix Kiula"
Дата:
Сообщение: Re: Are indexes blown?
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Are indexes blown?