English | 简体中文

api-docs / org.ktorm.dsl / cumeDist

cumeDist

The cume_dist window function, translated to cume_dist() in SQL.

Return the cumulative distribution of a value within a group of values; that is, the percentage of partition values
less than or equal to the value in the current row. This represents the number of rows preceding or peer with the
current row in the window ordering of the window partition divided by the total number of rows in the partition.
Return values range from 0 to 1.

This function should be used with ORDER BY to sort partition rows into the desired order. Without ORDER BY,
all rows are peers and have value N/N = 1, where N is the partition size.

Since
3.6.0