Re: user defined aggregate for percentile calculations

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: user defined aggregate for percentile calculations
Дата
Msg-id 20090406224914.GK4525@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: user defined aggregate for percentile calculations  (Kashmir <kashmir_us_1999@yahoo.com>)
Список pgsql-general
Kashmir wrote:
>
> thx for anwering!,
>
> i was more looking for a percentile calculation as in http://en.wikipedia.org/wiki/Percentile
> usually i do this in perl with the 'Statistics::Descriptive' module,
> but it would help me alot if i could solve this within the sql query,
> and would not have to push all the data into a perl arrays first..

Have you considered writing a function in the PL/R language?  It has
percentiles (actually quantiles) and all sorts of useful math stuff.

See http://www.joeconway.com/plr/

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Предыдущее
От: Kashmir
Дата:
Сообщение: Re: user defined aggregate for percentile calculations
Следующее
От: Greg Smith
Дата:
Сообщение: Re: user defined aggregate for percentile calculations