我需要检索所有不是经理人的员工
我尝试使用此代码>
SELECT MGR.LAST_NAME ,
E.EMPLOYEE_ID
FROM EMPLOYEES E , (SELECT M.LAST_NAME ,
M.EMPLOYEE_ID
FROM EMPLOYEES E , EMPLOYEES M
WHERE E.MANAGER_ID = M.EMPLOYEE_ID) MGR
WHERE E.EMPLOYEE_ID = MGR.EMPLOYEE_ID
答案 0 :(得分:2)
SELECT
E.LAST_NAME,
E.EMPLOYEE_ID
FROM EMPLOYEES E
WHERE EMPLOYEE_ID not in
(SELECT MANAGER_ID FROM EMPLOYEES where MANAGER_ID is not null)