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

Hi,

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: 64152
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)

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

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


Current Time: Sat Dec 10 20:29:41 CST 2016

Total time taken to generate the page: 0.17744 seconds