主要使用oracle 11g中提供的unpivot实现,其用法见官网:
http://www.oracle.com/technetwork/articles/sql/11g-pivot-097235.html
http://www.oracle.com/technetwork/articles/sql/11g-pivot-097235.html
示例:
select *
from (select '10' day10, '15' day15, '12' day12 from dual)
unpivot
(
state_counts
for state_code in ("DAY10", "DAY15", "DAY12")
)
order by state_code;
本文介绍了如何利用Oracle 11g提供的unpivot函数进行数据重塑,通过示例展示了具体应用过程及效果。
1万+

被折叠的 条评论
为什么被折叠?



