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 -> How to get all ancestors

How to get all ancestors

From: Steve <sprobst_at_yahoo.com>
Date: 27 Apr 2004 13:29:40 -0700
Message-ID: <ddc1a9fc.0404271229.23bcccc5@posting.google.com>


I am new to the use of "connect by prior". I have a standard parent child table (id, parentId) where the data graphically might look like this:

Great Grandpa
...Grandpa
......Dad
.........Son

Using connect by prior (or otherwise), I would like to find all the ancestors nodes for son (grouped by son). I don't want the tree flattened into one row as SYS_CONNECT_BY_PATH does.

Rather, I would like the resultset grouped:



Son Dad
Son Grandpa
Son Great Grandpa

Is there a way to do this with 'connect by prior'? Received on Tue Apr 27 2004 - 15:29:40 CDT

Original text of this message

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