If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Need to "enhance" the normal output of the "Connected By"/"Starts With" structure

Assume an EMPLOYEE table structured thus:
empidn
mgrempidn
empm
dptn

Where the mgrempidn is actually the empidn of another record and the top level
manager has a null mgrempidn.

You can pull a nest report of all associated records,
either top-down from a particular manager
select lpad(' ',3*level-3)||empm emp_tree,empidn,mgrempidn,dptn
from EMPLOYEE
connect by prior empidn = mgrempidn
start with mgrempidn = 98765;