Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to convert rows into columns with the dynamically in Oracle?

3537132Dec 21 2018 — edited Dec 21 2018

I need to convert row's into columns but year will be keep on changing, so that need to required  dynamic query. Could you please help here.

Here we are calculating each 12 rows sum.

Col1col2
2015100
2016120
2017120
2018110
201590
201680
201770
201820

Output:  

1st year(2015)2nd year(2016)3rd year(2017)4th Year(2018)
100120120110
90807020
Comments
Post Details
Added on Dec 21 2018
3 comments
236 views