Fraction of rows at or below the current row.
Section: Ranking functions
Cumulative distribution
sql
sql
SELECT player_id,
score,
CUME_DIST() OVER (ORDER BY score) AS cume_dist
FROM leaderboard;Explanation
`CUME_DIST` answers what share of rows are less than or equal to this one.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Ranking functions