SQL Plus contains the ranking functions rank() and dense_rank() that can
be use to rank tuples in an order determined by certain attributes or expres-
sions. Both functions generate ranks in either ascending or descending order,
but dense_rank() does not leave gaps in rank numbers when a tie occurs. The
default order is, as usual, ascending order.
Example 5.18.1 To rank the grade records based on the grade obtained in
any course we may write:
select stno, grade,
rank() over (order by grade)
from grades;
This will return the result: