我有两张表如下
EmployeeTable
:
Employe_Manger
:
请注意,E1
是E2
的经理,E3
和E4
是E5
的经理。
现在找到一个查询,找出经理姓名和员工姓名。
即。结果应该是
答案 0 :(得分:3)
SELECT one.EmployeeName AS "Employee", two.EmployeeName AS "Manager"
FROM Employee AS one
INNER JOIN Employee_Manager AS temp ON one.EmployeeId = temp.EmployeeId
INNER JOIN Employee AS two ON temp.ManagerId = two.EmployeeId
这是你想要达到的目标吗?