Introduction
Ranking functions
Selecting n-th row
Summary

Instruction

All right! Let's take a look at yet another way of ranking – ROW_NUMBER():

SELECT
  Name,
  Platform,
  EditorRating,
  ROW_NUMBER() OVER(ORDER BY EditorRating ASC) AS RowNumber
FROM Game;

Run this example query to see what's different with this function.

Exercise

Run the example. What difference do you see?

Each row gets its own unique rank number, so even rows with the same value get consecutive numbers.