Re: Median function in SQL
From: Martin Haltmayer <Martin_Haltmayer_at_KirchGruppe.de>
Date: 1998/03/02
Message-ID: <34FAB309.67E6AE54_at_KirchGruppe.de>#1/1
Date: 1998/03/02
Message-ID: <34FAB309.67E6AE54_at_KirchGruppe.de>#1/1
[Quoted] I am not sure, but
[Quoted] SELECT (MIN (revenue) + MAX (revenue)) * 0.5 ...
might do the trick.
Martin Haltmayer
Kevin Merritt wrote:
>
> Does anyone have any idea how to implement a MEDIAN function in Oracle? For
> example, I would like to perform the following SQL SELECT statement:
>
> SELECT MEDIAN(revenue) FROM company_financials WHERE revenue > 1000000
>
> I can write a stored procedure for each table/column I want to perform this
> for, but I would like to somehow extend the built-in environment to have
> the ultimate flexiblity.
>
> Thanks in advance
Received on Mon Mar 02 1998 - 00:00:00 CET