Is there a way to get to the root of the hierarchy with a single SQL statement?
The significant columns of the table would be: EMP_ID, MANAGER_ID.
MANAGER_ID is self joined to EMP_ID, as manager is also an employee. Given an EMP_ID is there a way to get to the employee (manager) (walking up the chain) where EMP_ID is null?
In other words the top guy in the org?
I'm using SQL Server 2008
Thanks.