Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Median function in SQL
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 CST
![]() |
![]() |