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

Home -> Community -> Usenet -> c.d.o.server -> Re: connect by: last row duplicated

Re: connect by: last row duplicated

From: News <Contact_404_at_hotmail.com>
Date: 3 Nov 2006 02:52:56 -0800
Message-ID: <1162551176.672158.251460@k70g2000cwa.googlegroups.com>

frank.van.bortel_at_gmail.com a écrit :

> Where's your 'START WITH' part of the statement?

OK thanks! . What about the nodes without children ? they dont appear when "start with" is specified

insert into test (ID, name, IDPARENT) values (1, 'A', null); insert into test (ID, name, IDPARENT) values (2, 'B', null);

column name format A10

select ID, LPAD (' ', 2*level-2) || name as name, level from test

   CONNECT BY prior ID = IDPARENT
   start with id = 1
/

       ID NAME LEVEL
---------- ---------- ----------

         1 A                   1


select ID, LPAD (' ', 2*level-2) || name as name, level from test

   CONNECT BY prior ID = IDPARENT
/

        ID NAME LEVEL
---------- ---------- ----------

         1 A                   1
         2 B                   1
Received on Fri Nov 03 2006 - 04:52:56 CST

Original text of this message

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