This function returns the rank of a row within an ordered partition.
- DENSE_RANK is only available as an analytic function (i.e., in combination with over_clause). For more information, refer to Analytic Functions section.
- The over_clause has to contain an order_clause part and must not contain a window_frame_clause.
- The same value is returned for rows with equal ranking. However, there are no gaps in the function results after duplicate values. This is different from RANK.
id, department, current_salary,
DENSE_RANK() OVER (PARTITION BY department ORDER BY current_salary) DENSE_RANK
FROM employee_table ORDER BY department, current_salary;