Problem
Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ranking number should be the next consecutive integer value. In other words, there should be no “holes” between ranks.
1 |
|
For example, given the above Scores table, your query should generate the following report (order by highest score):
1 |
|
Explanation
- For each score, we find out how many scores is greater than or equal to that score as the number of rank.
Solution
1 |
|