select to_char(wm_concat(a))
from (select a
from (select regexp_substr('1,2,3,0', '[^,]+', 1, level) a
from dual
connect by regexp_substr('1,2,3,0', '[^,]+', 1, level) is not null) tt
order by tt.a)
-------------------------------------------------------------------------------
wm_concat:【,】拼接字符串,多行转为一行
regexp_substr:特定字符截取字符串并转为多行
例:字符串 ‘1,2,3,0,7,6’
regexp_substr 执行结果:
0 |
1 |
2 |
3 |
6 |
7 |
wm_concat执行结果:0,1,2,3,6,7