oracle 同一表中父类关联子类
程序员文章站
2022-07-10 15:10:39
...
select * from IAPS_BRANCH where
PARENT_BRANCH_ID='$branchId$'
order by BRANCH_ID
-- 通过父类查找对应的所有子类
select branch_id from iaps_branch where
branch_id!='$parentBranchId$' start with branch_id =
'$parentBranchId$' connect by prior branch_id = parent_branch_id
PARENT_BRANCH_ID='$branchId$'
order by BRANCH_ID
-- 通过父类查找对应的所有子类
select branch_id from iaps_branch where
branch_id!='$parentBranchId$' start with branch_id =
'$parentBranchId$' connect by prior branch_id = parent_branch_id
推荐阅读