Re: Median function in SQL

From: Dave McRae <dmcrae_at_pcug.org.au>
Date: 1998/03/08
Message-ID: <6dtq9h$v7b$1_at_bomb.dynamite.com.au>#1/1


Opps, Srini, you're right. I had my median/mode confused. Sorry people :)

S Chavali wrote in message <34FD6DD6.3081E539_at_iname.com>...
>Dave,
>I believe the snippet of code below will return the *mode* value, not the
>*median*. If I remember my statistics right, *median* is the "middle" value
 is a
>list of ascending/descending values while the *mode* value is the number
 that
>occurs most often in such a list.

>>
>> select revenue, max(cntr) from
>> (select revenue, count(*) as cntr
>> from company_financials
>> where ....
>> group by revenue)
>>
Received on Sun Mar 08 1998 - 00:00:00 CET

Original text of this message