Loading section...

RANK and DENSE_RANK

Concepts: sqlRankDenseRank

How Ties Work Consider five students with test scores where two students scored 92. Here is how the three ranking functions differ on the exact same data: When Ties Matter: Rankings RANK Example DENSE_RANK Example Choosing Between Functions The choice between these three functions comes down to how you want ties handled and whether gaps in the numbering matter. Compare them side by side on the same query: