select emp_no, salary, DENSE_RANK() OVER(orderby[salary]desc) as rank
from salaries
where to_date='9999-01-01'orderby salary desc, emp_no
2、
select a.emp_no,a.salary,(selectcount(distinct b.salary)from salaries b
where b.to_date='9999-01-01'and b.salary>a.salary)+1as rank
from salaries a where a.to_date='9999-01-01'orderby salary desc,emp_no