Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Calculating of the Median of Data
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
-----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. 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 Message-----
Sent: Thursday, June 21, 2001 7:01 PM
To: Multiple recipients of list ORACLE-L
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 median values (5);
1 row created.
SQL> select avg(c1)
2 from (select count(*) m_count from median) A,
3 (select c1, rownum b_rownum from (select c1 from median order by
c1)) B
4 where b_rownum between (m_count / 2) and (m_count / 2) +1;
AVG(C1)
3
SQL> SQL> SQL> insert into median values (6);
1 row created.
SQL> select avg(c1)
2 from (select count(*) m_count from median) A,
3 (select c1, rownum b_rownum from (select c1 from median order by
c1)) B
4 where b_rownum between (m_count / 2) and (m_count / 2) +1;
AVG(C1)
4
Regards,
Waleed
-----Original Message-----
Sent: Thursday, June 21, 2001 6:54 PM
To: Multiple recipients of list ORACLE-L
Does anyone have a handy function for calculating the Median of data ?? It seems like it should be simple ...but
-----Original Message-----
Sent: Thursday, June 21, 2001 5:32 PM
To: Multiple recipients of list ORACLE-L
Thank you Jeremiah
-----Original Message-----
Sent: Thursday, June 21, 2001 5:01 PM
To: Multiple recipients of list ORACLE-L
This used to work on other platforms and versions, but my HP-UX 64 bit
binary
doesn't have any interesting strings any more:
strings $ORACLE_HOME/bin/oracle | perl -ne 'print if /^_[a-z]+_[a-z]/' | sort | uniq
The typical location for underscore parameters is x$ksppi:
(as SYS:)
select KSPPINM, KSPPDESC from x$ksppi where substr(KSPPINM,1) = '_';
The event codes (most of them) are documented in $ORACLE_HOME/rdbms/mesg/oraus.msg, after error number 10000.
-- Jeremiah Wilton http://www.speakeasy.net/~jwilton On Thu, 21 Jun 2001, Kevin Lange wrote: > Is there any place that has a list of ALL the things you can put into the > Init file and what they do ?? Not just the regular option strings.... I > can get a list of these from a couple of web sites , but all of the hidden , > and as far as I know, undocumented EVENT strings as well?? -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jeremiah Wilton INET: jwilton_at_speakeasy.net Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Fri Jun 22 2001 - 17:51:10 CDT
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Lange INET: kgel_at_ppoone.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Lange INET: kgel_at_ppoone.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Khedr, Waleed INET: Waleed.Khedr_at_FMR.COM Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Lange INET: kgel_at_ppoone.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Khedr, Waleed INET: Waleed.Khedr_at_FMR.COM Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Lange INET: kgel_at_ppoone.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).