Databases Reference
In-Depth Information
The query in step 3 is the right one for our goal, and you can see the correct results in the
next screenshot:
In step 4, we use another query to obtain the same result, using the
RANK()
analytical
function. In the following screenshot, you can see the output (an excerpt) of this query:
As we can see, in this case 31 rows are returned. The
RANK()
function assigns the same
rank to each row with the same value in the field of the
ORDER
BY
ranking clause. To obtain
the same result as earlier, we have to change the
WHERE
condition to the following:
WHERE ROWNUM < 11