Re: SELECT & recursion
From: vc <boston103_at_hotmail.com>
Date: 21 Mar 2006 12:34:58 -0800
Message-ID: <1142973298.069657.236610_at_e56g2000cwe.googlegroups.com>
Date: 21 Mar 2006 12:34:58 -0800
Message-ID: <1142973298.069657.236610_at_e56g2000cwe.googlegroups.com>
Bart Wakker wrote:
[...]
> 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