| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: SELECT & recursion
On 2006-03-19, Christopher Browne <cbbrowne_at_acm.org> wrote:
>
Which looks like this:
select * from hier_tab start with id=x
connect by prior id=parent
'prior id' means the one coming 'before' the child, which is the parent, i.e. in this fashion you search from child to parent.
you can also search from parent to all its descendants (children, grand children etc):
select * from hier_tab start with id=x
connect by prior parent=id
will give you the entire tree below some parent
I didn't know about the proposed recursive definition using WITH, I'll sure give that a try (have used oracles construct for several years). Received on Mon Mar 20 2006 - 01:38:16 CST
![]() |
![]() |