CUME_DIST function in Oracle

CUME_DIST is one of the vital Analytic functions of Oracle. It is used to get a cumulative distribution of a value in a group of values. The CUME_DIST function is supported in the various versions of the Oracle/PLSQL, including, Oracle 12c, Oracle 11g, Oracle 10g, and Oracle 9i.

Syntax:

CUME_DIST ( expr_1, expr_2, .. expr_n ) WITHIN GROUP ( ORDER BY expr_1, expr_2, .. expr_n  )

Parameters:

expr_1, expr_2, .. expr_n:
They are used to specify the expressions to be used for identifying a unique row in the group.

Example:

select CUME_DIST(100, 20) WITHIN GROUP (ORDER BY marks, extra)
from students;

Explanation:
Here, the cumulative distribution of a student with a total mark of 100 and an extra mark of 20 from within the students’ table will be returned.