Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Oracle Connect by Prior Example

Oracle Connect by Prior Example

Ratings: (0)|Views: 12|Likes:
Published by nelrick1984
This document describes an example for CONNECT BY PRIOR clause
This document describes an example for CONNECT BY PRIOR clause

More info:

Published by: nelrick1984 on Feb 01, 2012
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Nelrick RodriguesThe below example uses the SCOTT schema’s EMP table to explain how to find out an employee’s levelin the organization hierarchy.Shown above is the result of the query for SELECT * from EMP. Note EMPNO’s 7698, 7782 AND 7566 areall MANAGER’s and directly report to EMPNO = 7839 (PRESIDENT) i.e. Managers are at Level 2 in thehierarchy and people reporting to their respective managers will be at Level 3 in the hierarchy and soon.Now, in order to determine hierarchy level for Employees, we start from EMPNO = 7839 who is thePRESIDENT and having no MGR to trace the hierarchy from the top (i.e. PRESIDENT) to the bottom.Use the query shown below.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->