I have an employee table which includes ManagerID as a foreign key. To get the currently logged ManagerId on Employees, I use a statement like -
SELECT MgrId FROM Employees WHERE EmpId=@EmpId
@EmpId is currently Logged on Employees.
I need to get the currently logged on employees manager and the manager's manager in one statement. This involves using the output of the above statement as input of another select statement. I am unsure how to do this. Any help is much appreciated.