CUME_DIST is an ANSI-standard window (analytic) function that shows the relative standing of each row within a result set partition. It calculates the proportion of rows with a sort value less than or equal to the current row’s value, including ties. When ordered ascending, the first row in a partition always returns the lowest non-zero fraction; the last row always returns 1.0. Duplicate sort keys receive the same CUME_DIST value because they share the same cumulative position. Unlike PERCENT_RANK, CUME_DIST counts the current row in both the numerator and denominator, ensuring the minimum possible result is 1 ÷ n rather than 0. The function must be used with an OVER() clause containing ORDER BY; PARTITION BY is optional. It is deterministic only when the ORDER BY list uniquely identifies row order.
partition_expression
(any column or expression) - divides the result set into independent partitionssort_expression
(any column or expression) - defines row order inside each partition; required#VALUE!
PERCENT_RANK, NTILE, RANK, DENSE_RANK, ROW_NUMBER, WINDOW FUNCTIONS
SQL:2003 analytic functions
It returns the proportion of rows in the partition with sort values less than or equal to the current row, expressed between 0 and 1.
Rows that share the same ORDER BY value receive identical CUME_DIST results because they occupy the same cumulative position.
CUME_DIST includes the current row in its calculation, so the smallest possible value is 1 divided by the total rows in the partition.
Yes. Wrap the window function in a subquery or common table expression and then apply a WHERE clause, as shown in the examples.