컬럼에 'AAA,BBB,CCC,DDD' 라는 값이 있다면,
오라클 10G
Select Regexp_Substr('AAA,BBB,CCC,DDD','[^,]+', 1, Level) From Dual
Connect By Regexp_Substr('AAA,BBB,CCC,DDD', '[^,]+', 1, Level) Is Not Null
오라클 9i
SELECT SUBSTR (TEST,
INSTR (TEST, ',', 1, LEVEL) + 1,
INSTR (TEST, ',', 1, LEVEL + 1) - INSTR (TEST, ',', 1, LEVEL)
- 1
) AS ROWDATA
FROM (SELECT ',' || 'AAA,BBB,CCC,DDD' || ',' AS TEST
FROM DUAL)
CONNECT BY LEVEL <= LENGTH (TEST) - LENGTH (REPLACE (TEST, ',')) - 1
결과
댓글 없음:
댓글 쓰기