I have a table with data as shown below
Task Project Amt Period
----------- -------- --- ------
REVENUE 605 90020194 100 APR-20
IE FTE 90020194 10 APR-20
REVENUE 605 90020194 100 MAY-20
REVENUE 605 90020194 100 JUN-20
REVENUE 605 90020194 100 JUL-20
I need an SQL query to give the months in columns and respective amounts as shown below
Task Project APR-20 MAY-20 JUN-20 JUL-20
----------- -------- ------ ------ ------ ------
REVENUE 605 90020194 100 0 0 0
IE FTE 90020194 10 0 0 0
REVENUE 605 90020194 0 100 0 0
REVENUE 605 90020194 0 0 100 0
REVENUE 605 90020194 0 0 0 100
The periods are not fixed in number. I need a solution which can cope with a variable set of columns. Could anyone please help me on this.