1. 从根为1的节点开始遍历所有的孩子:
select * from xtlldw
start with dwbm = 1
connect by prior dwbm = parentdwbm ;
=========================================
1
101
10100
10101
1010101
1010102
1010103
10102
1010201
1010202
10103
....
102
10201
....
103
2. 从节点为10102的开始回溯它的根节点:
select distinct * from xtlldw
start with dwbm = 10102
connect by prior parentdwbm = dwbm ;
=========================================
1
101
10102
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余3页未读,立即下载