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 dumps

Connect by dumps

From: Ray <rbujarski_at_hotmail.com>
Date: 12 Nov 2003 20:40:01 -0800
Message-ID: <cb2954f2.0311122040.4fd40458@posting.google.com>


I have a hierarchical relationship that I want to dump the entire family given a parent. I have a table that tracks parents and children relationships, I want to create a view that dumps the entire family given a parent.
Scenario:
p1 has child p2, p2 has child p3.
Given p1, result set from view should be p2 and p3, given p2 result set from view should be p3 etc...

Here is my pl/sql that creates the view:

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.

Can anyone help with where I am going wrong? I am new to the connect by clause.
Thanks
Ray Received on Wed Nov 12 2003 - 22:40:01 CST

Original text of this message

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