Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Code for returning parents and children
In article <56e9c9f0.0106191049.13320607_at_posting.google.com>,
sfelten_at_ipsos-asi.com says...
>
>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?
>
Start with the children instead of the parent:
select question_desc
from adgraph.questionnaire
where job_id = 'TB0101639'
start with question_label = (select question_label
from questionaire where parent = 'Q1T_BNT' and job_id = 'TB0101639' ) and job_id = 'TB0101639'
>
>
>Thanks in advance,
>
>Scott Felten
-- Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/ Expert one on one Oracle, programming techniques and solutions for Oracle. http://www.amazon.com/exec/obidos/ASIN/1861004826/ Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Tue Jun 19 2001 - 18:26:35 CDT