使用分析函数解题
部分答案里的group by用法很不规范。
select t.dept_no,t.emp_no,t.salary from
(
select de.dept_no,de.emp_no,s.salary,row_number() over(partition by de.dept_no order by s.salary desc) as rk
from (select * from dept_emp where to_date='9999-01-01') de
inner join
(select * from salaries where to_date='9999-01-01') s
on de.emp_no=s.emp_no
)t
where t.rk=1;