sql - Percentile_cont / Oracle -


i using percentile_cont find percentile of distribution. table is:

class_id    rollnum marks  1             1        10 1             2        12 1             3        16 1             4        08 1             5        17 

i using query

select class_id,         percentile_cont(0.05) within group (order marks) marksperntl    mytable group class_id 

now, possible query roll number got percentile?

the percentile_cont function interpolates values, giving value of marks fall 5% percentile in distribution.

running query above data return (sqlfiddle @bob jarvis's comment):

| class_id | marksperntl | -------------------------- |        1 |         8.4 | 

your data set not contain rows marks 8.4. therefore, there isn't single rollnum value got percentile.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -