Oracle Connect BY用法

 select level  from dual connect by level <=10;

上例均可查询得到1 .. N 的序列。

SELECT A.*
,REGEXP_SUBSTR(A.MATERIAL_ID,'[^,]+',1,LVL,'C') MATERIAL_NO 
--,REGEXP_COUNT(A.MATERIAL_ID,',')+1 CNT
 FROM DWT_INPUT_LOT A 
,(SELECT LEVEL LVL FROM DUAL CONNECT BY LEVEL < 6)

 

posted @ 2023-10-12 17:13  bellin124  阅读(35)  评论(0编辑  收藏  举报