Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: connect by: last row duplicated
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 1Received on Fri Nov 03 2006 - 04:52:56 CST