select a.emp_no, b.emp_no as manager_no, a.salary as emp_salary, b.salary as manager_salary FROM ( select de.emp_no, de.dept_no, s.salary from dept_emp de inner join salaries s on de.emp_no = s.emp_no ...