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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Need help for function..

Re: Need help for function..

From: Keith Jamieson <keith_jamieson_at_hotmail.com>
Date: Mon, 8 Dec 2003 15:35:39 -0000
Message-ID: <5U0Bb.3694$nm6.19076@news.indigo.ie>


Oracle can do this for you, via a select statement

SQL> select * from mode_test
  2 /

  WAFER_ID RESISTANCE
---------- ----------

         1      1.741
         1      1.641
         1      1.743
         1      1.749
         1      1.659
         1      1.637

  1 select count(*),round(resistance,2) fr   2 mode_test
  3 group by round(resistance,2)
  4* order by count(*) desc
  5 /

  COUNT(*) ROUND(RESISTANCE,2)

---------- -------------------
         2                1.64
         2                1.74
         1                1.66
         1                1.75


Now if you do write a function around this sql then which resistance is the one which occurs most often?

Keith Jamieson.

"LT Cheah" <LT_Cheah_at_usa.net> wrote in message news:ahr8tv4u6oq9tli9fp7qe1kkh52bke018h_at_4ax.com...
> Is it possible to write the mode function using the available statistical
or
> analytical function that is provided by Oracle? If so, would appreciate
> some help here.
>
> I want to find the mode of resistance values for individual wafers from
our
> production data that would be rounded to one decimal point in ohms.
> where one wafer would have > 20000 resistance data points.
>
> I've gone to Tahiti and could not find the function for mode of a
population
> which in EXCEL would be =mode(range), ie the function that returns the
most
> frequently occurring, or repetitive value of the resistance in ohms (after
> rounding to one decimal place).
>
> I'm running Oracle 8.1.7
>
> Appreciate any help I can get.
Received on Mon Dec 08 2003 - 09:35:39 CST

Original text of this message

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