RANK() over_clause

Returns the rank of the current row within its partition, with gaps.
Peers are considered ties and receive the same rank. This function does
not assign consecutive ranks to peer groups if groups of size greater
than one exist; the result is noncontiguous rank numbers.

This function should be used with ORDER BY to sort partition rows into
the desired order. Without ORDER BY, all rows are peers.

over_clause is as described in
https://dev.mysql.com/doc/refman/8.0/en/window-functions-usage.html.

URL: https://dev.mysql.com/doc/refman/8.0/en/window-function-descriptions.html

