Aggregate working on ordered data

Поиск
Список
Период
Сортировка
От Christoph Dalitz
Тема Aggregate working on ordered data
Дата
Msg-id 20021219104031.7c4ab598.christoph.dalitz@hs-niederrhein.de
обсуждение исходный текст
Ответы Re: Aggregate working on ordered data  ("Peter Darley" <pdarley@kinesis-cem.com>)
Список pgsql-general
Hello,

while trying to implement an aggregate function "median", I am
facing two problems:

 a) In order to compute the median, the input values of the aggregate
    function need to come in ordered.

 b) Computation of the statistical median requires *two* runs of
    the aggregation: a simple count and a run until count/2 on the
    ordered data.

Is it at all possible to implemnt such an aggregate function in PostgreSQL?
If yes, all suggestions are appreciated.

Thanks,

Christoph Dalitz

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

Предыдущее
От: Conxita Marín
Дата:
Сообщение: Re: SELECT EXTRACT doesn't work with variables?
Следующее
От: Lee Kindness
Дата:
Сообщение: trouble caused by change in 7.3 handling of '' in integer context