I have an Employee
table, it's a self-referencing table, with managerId
refers to primary key empID
. I want to find 2 level records by a given empId
.
For example: if given empId=5
,
if empId=5
has children records, display them, as well as the children in children records.
The database is SQL Server 2005.
update: I wanna a full projection out