http://sqlfiddle.com/#!4/5f3b40/1CTE週期誤差
我有一個TABEL del
CMPI_CODE CMPI_ID_REF
---------- -----------
51
52 51
53
54
55
56
57
58
59
60
61
62
81
82 61
83
84
-
WITH RSFC(A,B,LVL) AS
(SELECT CMPI_CODE,CMPI_ID_REF,0 AS LVL FROM del R where CMPI_ID_REF is null
UNION ALL SELECT A,B,LVL+1 FROM RSFC R
INNER JOIN DEL F ON R.A = F.CMPI_ID_REF
)
select * from rsfc
這就像是顯示錯誤SQL Error: ORA-32044: cycle detected while executing recursive WITH query
你可以設置一個SQL小提琴顯示此錯誤? –
http://sqlfiddle.com/#!4/5f3b40 – Nisar