Home » SQL & PL/SQL » SQL & PL/SQL » from child to parent node!! (
from child to parent node!! [message #296277] Fri, 25 January 2008 08:52 Go to next message
Messages: 100
Registered: October 2005
Location: Bangalore
Senior Member


I need a query which will return the employee details with all of his supervisors ie from immediate supervisor to top-level manager.

The output should like,

Person_ID   Employee_Name             Supervisor
1000        Safeeq                    1001
1001        Joan                      1002
1002        Matt                      1003
1003        Lu                        NULL -- top level guy

The tables used are ,

1.Table : Per_all_people_f
column Name            DataType
Person_Id              Number(4)
Name                   Varchar2(100)

1.Table : Per_all_assignments_f
column Name            DataType
Person_id              Number(4)
Supervisor_id          Number(4)

Can someone help me please.
Re: from child to parent node!! [message #296278 is a reply to message #296277] Fri, 25 January 2008 09:04 Go to previous messageGo to next message
Michel Cadot
Messages: 63920
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1/ Post a test case (create table and insert statements)
2/ Post what you tried
3/ Post your Oracle version (3 decimals)

Re: from child to parent node!! [message #296650 is a reply to message #296277] Mon, 28 January 2008 09:08 Go to previous message
Messages: 168
Registered: December 2005
Senior Member
use connect by clause.

Previous Topic: SQL Tuning Topics
Next Topic: Hierarchical Query question
Goto Forum:

Current Time: Tue Oct 25 03:29:35 CDT 2016

Total time taken to generate the page: 0.08761 seconds