时间:2021-07-01 10:21:17 帮助过:2人阅读
使用递归还是与LEVEL
1 SELECT ID,
2 mt.materialtypename,
3 mt.parenttypeid,
4 SUBSTR(SYS_CONNECT_BY_PATH(mt.materialtypename,‘->‘),3) DisplayLevel,
5 level
6 FROM material_type mt
7 START WITH nvl(mt.parenttypeid,0)=0
8 CONNECT BY PRIOR ID=mt.parenttypeid;
CONNECT BY 子句定义表的相互联系
START WITH 子句定义的开始起点
level 查询深度
Oracle 递归函数与等级
标签: