Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQL Code for returning parents and children
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 - 13:49:09 CDT