select temp.dept_no,dept_emp.emp_no,salaryfrom salaries,dept_emp, ( select d.dept_no, max(salary) maxSalary from ...