Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

hierarchy

be433294nnJun 2 2006 — edited Jun 6 2006
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 4 2006
Added on Jun 2 2006
5 comments
292 views