--基数数据
1 SELECT ID, 2 mt.materialtypename, 3 mt.parenttypeid 4 FROM material_type mt;
使用递归还是与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 查询深度