字段
   flag
   013
   023
   034
...
得出结果  01234  就是根据字段flag 查询出出现的数字,重复的不计

解决方案 »

  1.   

    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
    然后行变列
      

  2.   

    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