aggregate function for median calculation

Поиск
Список
Период
Сортировка
От Thalis A. Kalfigopoulos
Тема aggregate function for median calculation
Дата
Msg-id Pine.LNX.4.21.0106181426130.24987-100000@aluminum.cs.pitt.edu
обсуждение исходный текст
Ответы Re: aggregate function for median calculation
Re: aggregate function for median calculation
Список pgsql-general
Hippl,
    I'm interested in calculating the median of a set of numbers. The algorithm requires that all values are known in
advance(ie stored in an array). So the question is: how can I store everything first in an array so I can later process
itgiven that I'd like this to be an aggregate function. I thought of creating an aggregate function and have the
state_function()gather all the values of a group in an array and the final_function() to do the actuall median
calculationon this array. But the intermmediate state cannot hold multiple values in an array (can it?)  
Any ideas on how to go with this?

TIA,
thalis


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

Предыдущее
От: Dennis
Дата:
Сообщение: Re: LARGE table won't use index?
Следующее
От: "Vilson farias"
Дата:
Сообщение: ERROR: cache lookup for userid 26 failed