hierarchy
Hi, I have an urgent problem. Can anyone help me solving this problem.
I habve the emp table like this:
emp
empno mgr ename
131101 131100 Jim
131100 130000 John
130000 1 Jack
1 King
Now I have this script:
SELECT
b.empno emp1,
a.empno emp
FROM
emp b,
emp a
CONNECT BY PRIOR a.mgr = a.empno
START WITH a.empno = b.empno
and b.empno = 131101;
The output should look like:
emp emp1
131101 131101
131101 131100
131101 130000
131101 1
How can I achive this? Is there an other way?
Please answer quick, it's very urgent !!!
Thanx Bea