1
EmployeeId, Name, ManagerId
1,Mac Manager, null
2,Sue Supervisor, 1
3,Earl Employee, 2
4,Sam Supervisor, 1
5,Ella Employee, 4
Given: Employee Id = 3
你能幫我用sql來讓員工和經理上鍊嗎?層次結構查詢sql server 2008
在這個例子中,結果將是
Earl
Sue
Mac