DENSE_RANK returns a NUMBER representing the rank of a row within a group of rows.


Syntax:

DENSE_RANK(expression1,…) WITHIN GROUP (ORDER BY)

Example:

SELECT DENSE_RANK(5000,103) WITHIN GROUP (ORDER BY SALARY, MGR_ID) as RESULT FROM EMP;

RESULT
————
43

Dense_rank – Oracle SQL Function
Tagged on: