Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SELECT CONNECT BY...
select lpad(' ',2*(level-1))||ename org_chart, empno, mgr,job
from emp
start with job='PRESIDENT'
connect by prior empno=mgr
mgr in this table the the empno of the manager.
dicaprio wrote:
>
> Hi,
>
> Someone can help me with an example about :
>
> "You use LEVEL with the SELECT CONNECT BY statement to organize rows from
> a database table into a tree structure. LEVEL returns the level number of a
> node in a tree structure. The root is level 1, children of the root are
> level 2, grandchildren are level 3, and so on..."
>
> Thanks in advances
> Veramente Grato....
>
> Clemente di Caprio
>
> dicaprio_at_tin.it
Received on Fri Feb 27 1998 - 00:00:00 CST
![]() |
![]() |