ORACLE(四) 行列操作

来源:互联网 发布:淘宝人才认证考试 编辑:程序博客网 时间:2024/06/04 19:24
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
0 0