select distinct o.orgid from baf_org_organization o CONNECT BY prior o.parentorgid = o.orgid START WITH o.orgid='11' and o.isvalid='Y';
慕工程0101907
浏览 332回答 2
2回答
慕盖茨4494581
with temp(orgid,parentorgid) as(select distinct o.orgid,o.parentorgid from baf_org_organization o where o.orgid='11' and o.isvalid='Y'union allselect distinct o.orgid,o.parentorgid from baf_org_organization oinner join temp b on o.parentorgid = b.orgid)select orgid from temp试下,对Oracle的语法不是太了解,我理解的是这个意思。