Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: tough RECURSIVE QUERY, How?

Re: tough RECURSIVE QUERY, How?

From: Peter McKenzie <pemmck_at_ibm.net>
Date: 1998/01/15
Message-ID: <69k06o$bq$1@marri.bs.wa.gov.au>#1/1

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_id
order by office_id
; Received on Thu Jan 15 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US