So I have one table which has employee number (empno)
, name(ename)
and manager number(mgr)
.
The question: List the names of all employees along with the name of their manager and the name of their manager's manager, with a blank at any left if a manager does not exist.
What I have so far:
SELECT a.ename, b.ename, b.mgr FROM emp a LEFT OUTER JOIN emp b ON a.mgr=b.empno
This shows the employee, their manager, and their manager's number... Anyone able to help me change the manager number in the third column into a name?