标签:
oracle 多行转一列,如下:
select to_char(wmsys.wm_concat(t.candi_supplier_id)) from PS.T_PS_BU_AWARD_SUPPLIER t;
通过oracle 10g 提供的wmsys.wm_concat函数,即可以完成行转列的效果。
一列转多行,如下:
with a as (select ‘/ABC/AA/AD/ABD/JI/CC/ALSKD/ALDKDJ‘ id from dual)
select regexp_substr(id,‘[^/]+‘,1,rownum) id from a
connect by rownum <= length(regexp_replace(id,‘[^/]+‘))
标签:
原文地址:http://www.cnblogs.com/sky_forever/p/4259052.html