Re: Calculating the median
From: Miguel Cruz <spam_at_un.u.nu>
Date: Mon, 04 Dec 2000 18:07:02 GMT
Message-ID: <a3RW5.10250$O5.264273_at_news.itd.umich.edu>
Date: Mon, 04 Dec 2000 18:07:02 GMT
Message-ID: <a3RW5.10250$O5.264273_at_news.itd.umich.edu>
In article <3A2BB04A.53C2F6C5_at_weinerfamily.org>, <sw_at_weinerfamily.org> wrote:
>> select a/b from
>> (select sum(the_column) as a, count(the_column) as b
>> from the_table where the_column is not null);
>
> This is the average. The median is the value in the middle of your numbers.
You're right, I wasn't paying attention. I suspect you could piece together enough rownum-based subselects to do this but it would be a nuisance. Now the mode, that I can do.
miguel Received on Mon Dec 04 2000 - 19:07:02 CET