Ranking values in a column is when you set every value as a number either higher than or lower than the other values. The lowest value (rank = 1) indicates the value with the first rank in your set of values.
column_i_want_to_rank
- this is the column that you want to rankASC
and DESC
- if you want to have the biggest values with rank = 1, then you need to add DESC
to your ORDER BY
clause. If you want the smallest values with rank = 1 then you can add ASC
to your ORDER BY
clause (this isn’t required, since the ordering is ASC
by default).