col level format 999

col empno format a20

col path format a30


select level, lpad(empno, level*4, ' ') as empno, ename, job, mgr, sal

    , sys_connect_by_path(ename, '/') as path

from emp e

start with empno = 7839    

connect by prior empno = mgr

order siblings by sal;



select level, lpad(empno, level*4, ' ') as empno, ename, job, mgr, sal

    , sys_connect_by_path(ename, '/') as path

from emp e

where empno = 7369

start with empno = 7839

connect by prior empno = mgr

order siblings by sal;

+ Recent posts