select wm_concat(id) from test1; --將多行轉換成1行,用','分割開
wm_concat
將1,2,3,4,5分成
1
2
3
4
5的形式
with t as (select '1,2,3,4,5' tt from dual)
select replace(regexp_substr(tt, '[^,]+', 1, level), ',',
'')
from t
connect by level <= length(tt) - length(replace(tt, ',',
'')) + 1