参考网址:http://blog.163.com/[email protected]/blog/static/82879994201192844355174/
一、多行转一列
select id, vnum, to_char(wmsys.wm_concat(vname)) c
from tab_test group by id,vnum;
二、一列转多行
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,‘[^/]+‘))
时间: 2024-10-03 08:46:56