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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Transpose Column Oracle Sql

User_3ZTH7Jun 30 2021

Hello All,
We have an oracle table in the below structure.
Table Name: poolagreements
image.pngThe requirement is to create a sql to generate report in the below format. As you can see, the last 6 months exposure should get transpose to rows. There might be cases where we have a year and month data missing as well which needs to be handled. I am trying with lag function without any luck, Appreciate if you check and suggest.

image.png
Thanks,
Pradeep.

This post has been answered by Solomon Yakobson on Jul 1 2021
Jump to Answer

Comments

Post Details

Added on Jun 30 2021
9 comments
644 views