Hello All,
We have an oracle table in the below structure.
Table Name: poolagreements
The 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.

Thanks,
Pradeep.