select dept_no, de.emp_no, salary as maxSalary from dept_emp de left join salaries s on de.emp_no = s.emp_no where (dept_no, salary) in ( select dept_no, max(salary) from dept_emp de left join salaries s on de.emp_no = s.emp_no group by dept_...