Re: median value

From: Ron <rmoeller_at_ladc.lockheed.com>
Date: 1996/12/12
Message-ID: <32B08D18.653D_at_ladc.lockheed.com>#1/1


Roger Wernersson wrote:
>
> Lisa Kilroy wrote:
> > I need to pull the median value out of a table for a particular field.
>
> Hello Lisa, no problem!
>
> SELECT MAX (value)
> FROM table
> WHERE value <= (
> SELECT AVG (value)
> FROM table
> )
>
> This might not be the fastest way but it works.
>
> --
> Sport radio: people listening to people watching people having fun
> Mailto:roger.wernersson_at_adra.se
> BTW: All opinions are mine, all mine, and nobody's but mine.

Nice try but this won't work. Example set of values:   3, 3, 3, 1
The average is 2.5 and the max(value) = 1. The median is 3.

Ron Received on Thu Dec 12 1996 - 00:00:00 CET

Original text of this message