写成这种结构更容易看懂吧

SELECT e.dept_no, e.emp_no, maxSalary
FROM dept_emp e, salaries s,(SELECT dept_no, max(salary) maxSalary
                            FROM dept_emp e INNER JOIN salaries s
                            ON e.emp_no = s.emp_no
                            GROUP BY dept_no) t
WHERE e.emp_no = s.emp_no 
      and e.dept_no = t.dept_no
      and s.salary = maxSalary
ORDER BY e.dept_no;