Oracle递归查询

SQL:

select * from PT_ORG_INFO START WITH id='102' CONNECT BY PRIOR id=par_id
View Code

连表递归查询SQL:

select info.* 
from PT_CAMERA_INFO info
join (select * from PT_ORG_INFO START WITH id='102' CONNECT BY PRIOR id=par_id) org on org.id=info.org_id
where 1=1
View Code

 

posted @ 2017-07-26 12:04  0611163  阅读(304)  评论(0编辑  收藏  举报