Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> needed: Percentile group function
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:
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