SELECT e.emp_no, d.emp_no AS manager FROM dept_emp AS e, dept_manager AS d WHERE e.dept_no = d.dept_no AND e.emp_no <> d.emp_no 首先先进行连表查询,然后筛选掉主管和员工相同的emp_no