oralce 中树型遍历
select
brp.BRANCHNAME "省公司" ,brp.BRANCHCODE "省机构代码",brp.BRANCHID "省机构ID"
from branch brp
start with brp.branchid='BRA0000000000001'
--BRANCHID 机构代码
--parentbranchid 上级机构代码
connect by prior brp.branchid=brp.parentbranchid;
select
brp.BRANCHNAME "省公司" ,brp.BRANCHCODE "省机构代码",brp.BRANCHID "省机构ID"
from branch brp
start with brp.branchid='BRA0000000000001'
--BRANCHID 机构代码
--parentbranchid 上级机构代码
connect by prior brp.branchid=brp.parentbranchid;
暂无评论。
评论功能维护中,当前仅展示历史评论。