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 -> hierarchical query - returning a treewalked subset

hierarchical query - returning a treewalked subset

From: SpaceMarine <spacemarine_at_mailinator.com>
Date: Wed, 07 Nov 2007 14:01:09 -0800
Message-ID: <1194472869.139869.54650@k79g2000hse.googlegroups.com>


hello,

(i had a previous post similar to this, but dont think it states the problem accurately).

for instance, if one searched for 'test%', it would return all product rows where the name begins w/ "test", but it would also include all rows that reference each row as a ParentID value.

i think this must be possible, probably w/ a CONNECT BY PRIOR, but im having much difficulty with it.

ive been trying w/ something like this, but it doesnt work:

    SELECT

        LEVEL,
        v.ObjID,
        v.Name,
        v.ParentID

    FROM
        v_myData v

  START WITH (UPPER(v.Name) LIKE UPPER('test%'))   CONNECT BY PRIOR ObjID = ParentID

...can this be done in a simple single statement? or should i just get all the rows in one statement, and then get all distinct rows that refer to each row in another statement, and lump them into one resultset?

thanks!
sm Received on Wed Nov 07 2007 - 16:01:09 CST

Original text of this message

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