用的这种方法不知道对不对,欢迎大家指正😂 WITH aa AS( SELECT a.dept_no,a.emp_no,b.salary, max(b.salary)over(PARTITION by a.dept_no) 最大 FROM dept_emp a LEFT JOIN salaries b ON a.emp_no = b.emp_no WHERE a.to_date = '9999-01-01') SELECT dept_no,emp_no,最大 FROM aa WHERE salary = 最大 ORDER BY dept_no