Ranking functions

Ranking functions let you compute a rank value for each row in a result set based on an ordering specified in the query.