oracle批量列转行逗号分隔-创新互联
示例:
创新互联专注于彭水苗族土家族企业网站建设,自适应网站建设,商城开发。彭水苗族土家族网站建设公司,为彭水苗族土家族等地区提供建站服务。全流程按需网站设计,专业设计,全程项目跟踪,创新互联专业和态度为您提供的服务with temp as (select '1,2,3' nums, 'a' names from dual union all select '4,5' nums, 'b' names from dual union all select '6,7' nums, 'c' names from dual union all select '8' nums, 'c' names from dual union all select '9,10' nums, 'c' names from dual union all select '11,12' nums, 'c' names from dual union all select '13,14' nums, 'c' names from dual union all select '15,16' nums, 'c' names from dual union all select '17,18' nums, 'c' names from dual union all select '19,20' nums, 'c' names from dual union all select '21,22,23,24,25,26,27,28,29,30,31,32,33,34' nums, 'c' names from dual ) select regexp_substr(nums,'[^,]+',1,b.lv) order_num,names from temp, (select level lv from dual connect by level<=(select max(length(regexp_replace(nums,'[^,]+'))+1) from temp)) b --用于分配行数(行数取大的nums分隔数) where b.lv <=length(regexp_replace(nums,'[^,]+'))+1 order by order_num另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
网页题目:oracle批量列转行逗号分隔-创新互联
转载注明:http://pwwzsj.com/article/dhigse.html