Re: Calculating of the Median of Data

2001-06-22 Thread Jared . Still
Does anyone have a handy function for calculating the Median of data ?? It seems like it should be simple ...but Kevin, Maybe not as simple as you think. :) Here's an example in SQL. You may want to dig through the archives, as this was discussed at some lenght a few months ago. Ross

RE: Calculating of the Median of Data

2001-06-22 Thread Kevin Lange
Waleed; Well, I am afraid, its not going to be this simple on my version of Oracle, 8.0.5. Apparently, you can not do an order by in the from statement on this version so I can not get the crucial order of the data. Thanks anyway. I may have to resort to an pl/sql function. -Original

RE: Calculating of the Median of Data

2001-06-22 Thread Kevin Lange
Khedr; That was the kind of thing I was looking for. A simple select (relatively) that can be added to another data select that I have for a report I am producing for a client. Thanks And thanks to all that answered ! Kevin -Original Message- Sent: Thursday, June 21, 2001 7:01 PM

RE: Calculating of the Median of Data

2001-06-22 Thread Khedr, Waleed
You can replace the order by BY group by. Group by does an implicit sort. Regards, Waleed -Original Message- Sent: Friday, June 22, 2001 1:31 PM To: Multiple recipients of list ORACLE-L Waleed; Well, I am afraid, its not going to be this simple on my version of Oracle, 8.0.5.

RE: Calculating of the Median of Data

2001-06-22 Thread Kevin Lange
Fraid group by will not work either it removes the duplicate rows and changes the median. -Original Message- Sent: Friday, June 22, 2001 4:19 PM To: Multiple recipients of list ORACLE-L You can replace the order by BY group by. Group by does an implicit sort. Regards, Waleed

RE: Calculating of the Median of Data

2001-06-22 Thread Khedr, Waleed
Never surrender! use: select c1 from median group by c1,rownum in the inner query! Regards, Waleed -Original Message- Sent: Friday, June 22, 2001 7:58 PM To: Multiple recipients of list ORACLE-L Fraid group by will not work either it removes the duplicate rows and changes the

RE: Calculating of the Median of Data

2001-06-21 Thread Khedr, Waleed
What about this: SQL create table median ( c1 number ); Table created. SQL insert into median values (1); 1 row created. SQL insert into median values (1); 1 row created. SQL insert into median values (3); 1 row created. SQL insert into median values (5); 1 row created. SQL insert into

RE: Calculating of the Median of Data

2001-06-21 Thread Larry Elkins
Kevin, I don't have the answer. And my Celko book has variations on doing this. But, the first thought off the top of my head was that we might be able to make this real easy via some of the analytical functions that first came to be in 8.1.6. Anyway, I struggled with it a bit and decided to do