把原表通过sql语句来处理显示成目标表,sql怎么写才能实现表行列的完全转换,不要部分转换?
1个回答
展开全部
select regexp_substr(deptno, '[^,]+', 1, 1) as str1,
regexp_substr(deptno, '[^,]+', 1, 2) as str2,
regexp_substr(deptno, '[^,]+', 1, 3) as str3,
regexp_substr(deptno, '[^,]+', 1, 4) as str4
from (select wmsys.wm_concat(deptno) deptno
from dept
union all
select wmsys.wm_concat(dname)
from dept
union all
select wmsys.wm_concat(loc) from dept) t
希望你笑纳
regexp_substr(deptno, '[^,]+', 1, 2) as str2,
regexp_substr(deptno, '[^,]+', 1, 3) as str3,
regexp_substr(deptno, '[^,]+', 1, 4) as str4
from (select wmsys.wm_concat(deptno) deptno
from dept
union all
select wmsys.wm_concat(dname)
from dept
union all
select wmsys.wm_concat(loc) from dept) t
希望你笑纳
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询