Maxim Mironjuk
-
January 14, 2026
RANK and DENSE_RANK answer the question of a row's absolute position within a sorted set, but in many analyses the position itself is not what matters, the relative placement compared to the whole set is. Does a value fall in the top ten percent, somewhere in the middle, or closer to the bottom of the distribution. That is exactly what PERCENT_RANK and CUME_DIST were built for, two window functions that return a continuous percentage instead of a fixed rank number. This article covers the underlying formulas, the practical difference between the two functions, how they compare to NTILE, and typical edge cases with small or heavily skewed data sets.