Im having the following table , each employee have a manager, if a guy is his own manager den the managerid field is null, i want emid name and manager id as result table name is employee
emid name managerid
1 raj null
2 ram 1
3 ravi null
4 arvind 3
5 rithu 2
and i want the result as
emid name managername
1 raj raj
2 ram raj
3 ravi ravi
4 arvind ravi
5 rithu ram
1 Answer