Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: tough RECURSIVE QUERY, How?
NNOOR wrote in message <69in86$j7v_at_examiner.concentric.net>...
>
>Hi,
>Following is the scenerio:
>
>An office can have one or more sub-offices.
This should do the trick -
select distinct office_id
from office
where office_id not in
(
select parent_off_id
from office
)
start with parent_off_id = &1 or office_id = &1 connect by parent_off_id = PRIOR office_idorder by office_id