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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Code for returning parents and children

Re: SQL Code for returning parents and children

From: john sprague <bearpig_at_attglobal.net>
Date: Tue, 19 Jun 2001 19:32:38 -0500
Message-ID: <3B2FEF26.8D22E184@attglobal.net>

pseudo-table in the querry.

select blah_blah
from

    ( ps1...... ) ax,
    ( ps2.......) hammer,
    (ps3 ...... ) anvil

where
  ax.conditional = hammer.conditional
or
  ax.conditional = anvil.conditional

There are variations but this should get you started down the raod. It looks like you have the seed for the querry - ie. the initial condition to satisfy . I might have misunderstood...

jds

scott felten wrote:

> I have a need to query a table and return the parent and its parent
> and so on... as well as all the children for the row (but no grand
> children).
>
> I can get to the parents with the following code, but am unable to
> return the children. Any suggestions?
>
> select question_desc
> from adgraph.questionnaire
> where job_id = 'TB0101639' start with question_label ='Q1T_BNT' and
> job_id = 'TB0101639'
> connect by question_label = prior parent and job_id = 'TB0101639'
>
> Thanks in advance,
>
> Scott Felten
Received on Tue Jun 19 2001 - 19:32:38 CDT

Original text of this message

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