Re: [GENERAL] Median, Quartile and Percentile Aggregate Functions

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: [GENERAL] Median, Quartile and Percentile Aggregate Functions
Дата
Msg-id Pine.LNX.4.21.0003040343420.489-100000@localhost.localdomain
обсуждение исходный текст
Ответ на Median, Quartile and Percentile Aggregate Functions  (Patrik Hall <phall@phall.kdsoft.fi>)
Список pgsql-general
Patrik Hall writes:

> I am in need of median, quartile and percentile functions in postgres.
>
> Has anybody implemented any of them allready?

Haven't heard, but if you can come up with a way to calculate them with a
single pass over the data rows (keeping several state variables, if
necessary) then you're half way there to implementing your own aggregate
function. See the Programmer's Guide on how that might be done.

Incidentally I couldn't think of a way to do just that. In that case it
will be *hard*.

--
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [GENERAL] Nested tables
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [GENERAL] Illegal use of aggregates or non-group column in target list