在cte中缺少关键字

时间:2014-05-17 17:44:49

标签: sql oracle

with RSFC(CK,PK,LVL,HIER) as (
  select EMPLOYEE_ID,MANAGER_ID,0 as LVL,EMPLOYEE_NAME as HIER from COMPANY where MANAGER_ID is null
  union all
  select EMPLOYEE_ID,MANAGER_ID,LVL+1,HIER || '/' || EMPLOYEE_NAME from RSFC R inner join COMPANY F on R.CK = F.MANAGER_ID
)
SEARCH BREATH first by CK set ORDR
select a.LVL,a.CK,a.PK,a.HIER,ORDR
from RSFC a order by ORDR

错误

ORA-00905: missing keyword
00905. 00000 -  "missing keyword"
*Cause:    
*ACTION:
Error at Line: 244 Column: 8

1 个答案:

答案 0 :(得分:1)

您在D行中缺少SEARCH BREATH first by CK set ORDR

应为SEARCH BREADTH first by CK set ORDR