Re: idea - new aggregates median, listagg

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "David Fetter" <david(at)fetter(dot)org>, "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: idea - new aggregates median, listagg
Date: 2009-12-16 15:17:16
Message-ID: 4B28A59C020000250002D5EB@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
> 2009/12/15 David Fetter <david(at)fetter(dot)org>:

>> http://www.simple-talk.com/sql/t-sql-programming/median-workbench/
>
> In this article the are two medians - statistical and financial. I
> am for both. But only one can be named "median".

Well, since the statistical median requires that you specify whether
you want the left or right median (in case there are an even number
of values), you could either have two median functions, one of which
would take an extra parameter for this, or you could have median,
left_median, and right_median functions.

-Kevin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Kreen 2009-12-16 15:18:18 Re: Patch: Remove gcc dependency in definition of inline functions
Previous Message Tom Lane 2009-12-16 15:10:30 Re: Patch: Remove gcc dependency in definition of inline functions