var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Possible newbie SQL question. Help.
I have the below table
emp_id, emp_name, manager_id, level
level 3 employees report to level 2 employees than report to level 1 employees
I need to select all level 3 employees, their direct manager (level 2) and indirect manager (level1).
Re: Possible newbie SQL question. Help.
Treat each level as a separate table:
select l3.emp_name, l2.emp_name, l1.emp_name
from emp l1, emp l2, emp l3
where l1.emp_id = l2.manager_id
and l2.emp_id = l3.manager_id;
Or in Oracle there is "CONNECT BY" to perform a tree-structured query.