首页 > 代码库 > [oracle] 组织架构退格显示 connect by

[oracle] 组织架构退格显示 connect by

 

1. 按组织架构关系退格显示

create or replace view v_vieworg as
select --v.OBJID,v.OBJNAME
level as levelid,
lpad(‘        ‘,2*level-2)||v.OBJNAME as OBJNAME,v.OBJID,v.OBJCODE,v.ISDEPT,v.PARENTAREAID,v.PARENTDEPTID,v.ParentID,v.canceled
from v_organddept v
start with v.OBJID=100001
connect by prior v.OBJID=v.ParentID;

 

[oracle] 组织架构退格显示 connect by