해당 오라클쿼리를 mssql 퀴리로 변경 하고싶습니다.
SELECT code FROM (
SELECT REGEXP_SUBSTR( code, '[^;]+', 1, LEVEL ) AS code
,LEVEL AS lv
,LAG( LEVEL, 1, 0 ) OVER( PARTITION BY col1 ORDER BY LEVEL ) AS lg
FROM (
SELECT 'AAA' AS col1, '010201;010202;010203;010204;010205;010206' AS code
)
CONNECT BY REGEXP_SUBSTR( code, '[^;]+', 1, LEVEL ) IS NOT NULL
)
도와주세요
|