Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL PERCENTILE_DISC Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: PERCENTILE_DISC

Definition:
The Oracle PL/SQL function PERCENTILE_DISC is a built in inverse distribution analytic function which works on discrete distribution model to get the median of a column value. It takes a numeric input which is assumed as percentile rank and grouping specification as input. It returns the least value whose percentile is greater than or equal to the given percentile.

Example Syntax:

PERCENTILE_DISC() WITHIN GROUP (ORDER BY   NULLS ) 
OVER ();


Example Usage:

The SQL statement below lists the median salary which is greater than or equal to percentile of 0.5 within each department:

SQL> SELECT EMPNO, DEPTNO, SALARY , PERCENTILE_DISC(0.5)  
WITHIN GROUP (ORDER_BY SALARY DESC)
OVER (PARTITION BY DEPTNO) "Percentile_DISC"
FROM EMPLOYEE



Related Links:

Related Code Snippets:
  • PERCENTILE_DISC - An inverse distribution function that assumes a discrete distribution model. It ...
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 89 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?