문제

I have a column which contains a String with numbers like '12345' (no separator or blanks) and I want to split this column to rows for each character:

From:

 COLUMN
 ------------------
 12345

To:

 COLUMN
 ------------------
 1
 2
 3
 4
 5

This Should work in a single select so that I can use it like this:

... AND WHERE SOMECOLUMN NOT LIKE (... THE SELECT ...)

도움이 되었습니까?

해결책

with temp as (select '12456' as str from dual)
select substr(str,level,1)
from temp
connect by level <= length(str);

Result:

1
2
4
5
6
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top