Home » SQL & PL/SQL » SQL & PL/SQL » hierarchy
hierarchy [message #314021] Tue, 15 April 2008 10:00 Go to next message
Messages: 198
Registered: April 2005
Location: Cairo - Egypt
Senior Member
I know that's oracle can build a hierarchy from above to bottom by "connect by prior" statement.
But can I build this hierarchy to give me the the data from bottom to above.
i.e if I have an employee with number 4 and has a manager with number 3 so
If I have the employee 4 how can I get his manager

Re: hierarchy [message #314023 is a reply to message #314021] Tue, 15 April 2008 10:04 Go to previous messageGo to next message
Michel Cadot
Messages: 65144
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is NOT an expert question.

It is clearly stated in the forum description: "Newbies should not post to this forum!"
Expert notion is defined in the sticky: Not an EXPERT? Post in the NEWBIES forum, NOT here
Rules are described in: OraFAQ Forum Guide
Read them, follow them including what is said about formatting.

As you are an expert, I don't answer the question because you obviously already knows it.

Re: hierarchy [message #314151 is a reply to message #314023] Tue, 15 April 2008 22:01 Go to previous message
Messages: 3727
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Rather than
CONNECT BY PRIOR emp_num = manager

CONNECT BY emp_num = PRIOR manager
START WITH emp_num = 3

Ross Leishman
Previous Topic: What would be the best solution to copy/process the data?
Next Topic: bulk collect problem
Goto Forum:

Current Time: Sat Aug 19 15:42:58 CDT 2017

Total time taken to generate the page: 0.11701 seconds