I have a task in hand to determine the bosses both direct and indirect
for a given employee. Since even the boss is an employee, i have
defined it as a simple self referential table.
Table has 3 Columns
employee_id // PK
boss_id // FK - Pointing to the same table to the employee_id
I have 5 rows now in the table:
employee_id employee_name boss_id
1 John,Chambers NULL
2 Jacob, Philips 1
3 Tom, Hanks 2
4 Mathew,Con 3
5 Hilary,clinton 2
I need sql query which can return the direct and indirect bosses for
given emploee_id in the ...