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 -> connect by: last row duplicated

connect by: last row duplicated

From: News <Contact_404_at_hotmail.com>
Date: 3 Nov 2006 00:37:53 -0800
Message-ID: <1162543073.594851.32290@b28g2000cwb.googlegroups.com>


CREATE TABLE test
(

    ID       	NUMBER        NOT NULL,
    name      	VARCHAR2(10)     NULL,
    IDPARENT 	NUMBER            NULL

)
/

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

column name format A10

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

   CONNECT BY prior ID = IDPARENT
/

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

         2 AA                  1
         1 A                   1
         2   AA                2


All results OK except the last row which is always duplicated with different level.
Is this another 10g bug ?? Received on Fri Nov 03 2006 - 02:37:53 CST

Original text of this message

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