> Sure.  In your example, though, my concern would be that other than
the order in which you've listed the items, there's no way to 
> tell which element lower than level 1 is a child of which other
element.
> Do you have a parent ID field or some such that relates an item to its
parent item or are you relying on the query returning 
> things in the proper order?  The latter seems iffy to me.

Indeed, the query takes care of it.

SELECT
        HDR_ID, HDR_PARENT_ID, HDR_TITLE,
        LEVEL
FROM
        myTable
START WITH
        HDR_PARENT_ID IS NULL
CONNECT BY
        PRIOR HDR_ID=HDR_PARENT_ID
ORDER SIBLINGS BY
        HDR_SORT_ORDER

> But, if you have a way of knowing, then you could use simple recursion
to build your list:  Loop over each level 1 item, find its 
> children and loop over them to find their children and loop over them,
etc.
> Doesn't matter how many levels deep except with respect to
performance.

I was hoping to avoid recursion, actually. I'll absorb your suggestion
though.

Since this can't nest very deeply I'm probably over thinking it and
should just go with a couple of QofQs.

Thanks.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:242661
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to