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 dumps

Re: Connect by dumps

From: foolishHurts <silverback_at_photobooks.com>
Date: Thu, 13 Nov 2003 10:28:13 -0500
Message-ID: <d587rvks328l3frfav7nthonbbmvn0tgj8@4ax.com>


Thanks for a great way to get a hierarchy. BUT... Give a mouse a cookie and it wants a glass of milk. There is one thing I can not find.

Given data as follows, I would like to control the order of traversal such that child 3 is traversed before child 2 (same tree structure, reverse order) :

The ability to psudo order within child grouping would allow me to blow off other tools and just do the whole thing in SQLPLUS.

Thanks,

Evan

PARENT CHILD
---------- ----------

         1          2
         2          4
         4
         2          5
         5          8
         8
         5          9
         9
         1          3
         3          7
         7
         3          6
         6

Desired result....
PARENT      CHILD
---------- ----------
         1          3
         3          6
         6
         3          7
         7
         1          2
         2          5
         5          9
         9
         5          8
         8
         2          4
         4


On Thu, 13 Nov 2003 13:22:18 +0000 (UTC), Lucyna Witkowska <ypwitkow_at_nospamcyf-kr.edu.pl> wrote:

>Ray <rbujarski_at_hotmail.com> wrote:
>
>> create view treepath
>> as
>> SELECT parent, child
>> FROM td_view_dependants
>> START WITH parent in (select parent from td_view_dependants)
>> CONNECT BY child = prior parent
>
>> However the results from this are p1 has p2 and p2, p2 has p3.
>
>If you want start with p1 just write:
>START WITH parent = 'p1'
>
>If you want to go down the tree:
>CONNECT BY PRIOR child = parent
>
>greetings,
>LW
Received on Thu Nov 13 2003 - 09:28:13 CST

Original text of this message

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