1.創建測試表,createtabletest_connect(idnumber,p_idnumber);
2.插入測試數據,
Insertintotest_connectvalues(1,1);
Insertintotest_connectvalues(2,1);
Insertintotest_connectvalues(3,2);
Insertintotest_connectvalues(4,3);
提交;
3.查詢數據表的內容,選擇*fromtest_connect,
4.執行遞歸查詢語句,將答案添加到nocycle元素中,就不會有[ora-01436:CONNECTBYerrorintheuserdata]。執行結果如下:
Select*
來自test_connectt
從id=4開始
由nocyclepriort連接。p_id=t.i.