Documentation Index
Fetch the complete documentation index at: https://docs.oxla.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheCUME_DIST() function is a window function used to calculate the cumulative distribution of a value within a set of values. This function returns a value between 0 and 1, representing a relative position of a row within a partition or result set.
Syntax
The syntax for this function is as follows:Parameters
- (): this function takes no arguments but parentheses is required
Example
For the needs of this section we will use a simplified version of thefilm table from the Pagila database, containing only the title, length and rating columns.
CUME_DIST() function to calculate the cumulative distribution of film lengths: