select emp_no,salary,dense_rank() over(order by salary desc) t_trunk from salaries
where to_date='9999-01-01' order by t_trunk asc,emp_no asc;