Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: hierarchical question - grabbing everything related
On Nov 6, 9:52 am, SpaceMarine <spacemar..._at_mailinator.com> wrote:
> this is because the 3rd party app i am working with breaks if it comes
> across an orphaned row -- that is, if any rows reference a ParentID, i
> need to also have those parent-rows present. and if those parent-rows
> have parents, they need to be present... etc.
i think im going to try a different approach.. i what i need is a reverse hierarchy query. like so:
SELECT
LEVEL,
ObjectID,
Name,
ParentID AS ChildID
FROM
tbl_Parts
START WITH (UPPER(v.Name) LIKE UPPER('test%'))
--CONNECT BY PRIOR ObjectID = ParentID
CONNECT BY PRIOR ParentID = ObjectID --swapped the relation around
ORDER SIBLINGS BY ObjectID;
...going to try that. Received on Tue Nov 06 2007 - 10:18:41 CST