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 -> needed: Percentile group function

needed: Percentile group function

From: Eric Spear <espear_at_deans.umd.edu>
Date: 1998/09/09
Message-ID: <35F6C78B.8443E7BF@deans.umd.edu>#1/1

You are all familiar with the average group function:

select race,

       avg(sat_score)
from students
group by

       race;

I would like a percentile function. It would work in two ways:

  1. Return the value for that percentile:

select race,

       PERCENTILE_TO_VALUE(sat_score, 75) from students
group by

       race;

2) Return the percentile for the given value:

select race,

       VALUE_TO_PERCENTILE(sat_score, 1200) from students
group by

       race;

My first thought was a user function, but Oracle (7 or 8) doesn't seem to allow user group functions. It has to be a group function because the groupings can change depending on the whims of the user.

Does anyone have any ideas? Does Oracle sell perhaps an add on that would let me do this? Is there a programmable solution?

Thanks in advance! Received on Wed Sep 09 1998 - 00:00:00 CDT

Original text of this message

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