Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SELECT CONNECT BY...

Re: SELECT CONNECT BY...

From: Quinton McCombs <quintonm_at_bellsouth.net>
Date: 1998/02/27
Message-ID: <34F7195A.7422B2E5@bellsouth.net>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US