Transpose one row into many rows Oracle

◇◆丶佛笑我妖孽 提交于 2019-12-01 08:53:42

Are you using Oracle 11g? Did you try pivot and unpivot?

More info here.

sure. Do

select 'Col1' ColName, Col1 Value from srctable union all
select 'Col2', Col2 from srctable union all
select 'Col3', Col3 from srctable union all
select 'Col4', Col4 from srctable
Wiretap

I'm guessing you don't have the Oracle version with build in Pivot table support. Unfortunately it's never very clean code, as you have to build up each row.

See this older post for an example

transpose-select-results-with-oracle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!