with t as (select '0123' id from dual union all select '0173' id from dual ) SELECT distinct substr(id, LEVEL, 1) FROM t CONNECT BY LEVEL <= length(id) order by 1 然后行变列
with t as (select '0123' id from dual union all select '0173' id from dual ) SELECT replace(wm_concat(distinct substr(id, LEVEL, 1)),',','') FROM t CONNECT BY LEVEL <= length(id) order by 1
SELECT distinct substr(id, LEVEL, 1) FROM t CONNECT BY LEVEL <= length(id) order by 1
然后行变列
SELECT replace(wm_concat(distinct substr(id, LEVEL, 1)),',','') FROM t CONNECT BY LEVEL <= length(id) order by 1