Summer Deals - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Ranking functions
Selecting n-th row
Summary

## Instruction

Good job! You may have noticed that the rank given by the function seems counterintuitive. For example, when we showed the rank sorted by EditorRating, the game with the lowest score got the first rank. We usually want it the other way around – rank 1 should be occupied by the highest score. Luckily, this requires only a very minor change to our query:

SELECT
Name,
Platform,
EditorRating,
RANK() OVER(ORDER BY EditorRating DESC) AS Ranking
FROM Game;


Voila! We've added DESC after the column name in OVER( ... ) and the ranking order is reversed.

## Exercise

Let's use DENSE_RANK() to show the latest games from our studio. For each game, show its name, genre, date of release. Use DENSE_RANK() to rank results by release date in the descending order. Name the new column Ranking.

### Stuck? Here's a hint!

Use:

DENSE_RANK() OVER(ORDER BY ReleaseDate DESC)