ROW_NUMBER -
Always provides a unique number to each row, regardless of ties. It does not consider any rank gaps.
SELECT
EMPLOYEE_ID, DEPARTMENT_ID, SALARY ,
ROW_NUMBER() OVER (PARTITION BY DEPARTMENT_ID Order by salary desc)
as ROW_NUMBER_DETAILS
FROM employees1;