I have got a problem. i.e. there is a table which contains employee and their managers details.
example:
TableA
EMPID MangaerID
1 5
2 4
3 1
4 3
5 no Manager
Now I need to get another table populated with this data in the following way.
TableB
EMPReporting ManagerID
1 5
2 4
2 3
2 1
2 5
3 1
3 5 and so on along with other column values.
I have to get the employeeID, his manager'IDs and his manager's manageID. Please suggest me the best way.