Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Calculating of the Median of Data

RE: Calculating of the Median of Data

From: Khedr, Waleed <Waleed.Khedr_at_FMR.COM>
Date: Thu, 21 Jun 2001 15:55:24 -0700
Message-ID: <F001.00332FD5.20010621160037@fatcity.com>

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-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: 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).
Received on Thu Jun 21 2001 - 17:55:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US