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 ora-01436

Re: connect by ora-01436

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 17 Feb 2006 07:27:43 -0800
Message-ID: <1140190063.752448.150590@z14g2000cwz.googlegroups.com>


PJP, logically how can the first row in a hierarchy have values in the prior columns? You have three rows in your test data that refer back to themselves: 1,1,1,1 and 5,5,5,5 and 6,6,6,6.

 UT1 > insert into t values (1, 1, NULL, NULL);

1 row created.

UT1 > insert into t values (2, 2, 1, 1);

1 row created.

UT1 > insert into t values (3, 3, 1, 1);

1 row created.

UT1 > insert into t values (4, 4, 2, 2);

1 row created.

UT1 > insert into t values (5, 5, NULL, NULL);

1 row created.

UT1 > insert into t values (6, 6, NULL, NULL);

UT1 > insert into t values (7, 7, 6, 6);

1 row created.

UT1 > commit;

Commit complete.

UT1 >
UT1 > select *
  2 from t
  3 start with (c is null and d is null)   4 connect by prior c = a and prior d = b   5 /

         A B C D
---------- ---------- ---------- ----------

         1          1
         5          5
         6          6

UT1 > select *
  2 from t
  3 start with (c is null and d is null)   4 connect by c = prior a and d = prior b   5 /

         A B C D
---------- ---------- ---------- ----------

         1          1
         2          2          1          1
         4          4          2          2
         3          3          1          1
         5          5
         6          6
         7          7          6          6

7 rows selected.

HTH -- Mark D Powell -- Received on Fri Feb 17 2006 - 09:27:43 CST

Original text of this message

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