Re: MEDIAN as custom aggregate?

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: MEDIAN as custom aggregate?
Дата
Msg-id web-148453@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на Re: MEDIAN as custom aggregate?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Tom,

> Um ... does that work?  I thought LIMIT was fairly restrictive about
> what it would take as a parameter --- like, constants or $n
> parameters
> only.
> 
> I do not know of any median-finding algorithm that doesn't require a
> depressingly large amount of storage...

Me neither.  You're right; the query didn't work.  

Here's a link to the median-finding function I posted to the CookBook:

http://www.brasileiro.net/postgres/cookbook/view-one-recipe.adp?recipe_id=1654

Anyone who can improve it is welcome!

-Josh

______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


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

Предыдущее
От: Vivek Khera
Дата:
Сообщение: Re: VARCHAR vs TEXT
Следующее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: to_char()??