You need to execute a recursive query—that is a query that references itself.
Use a recursive Common Table Expression (CTE).
This solution uses a recursive CTE to return a list of employees and their managers from the HumanResources.Employee table in Adventur...