Hi,
Below is my DDL
CREATE TABLE #Temp
(
Id INT,
ReportMonth int,
ReportQuarter int,
PaymentAmount MONEY
)
INSERT INTO #Temp
VALUES (123,1,1,25), (123,3,1,50),(123,4,2,50),(123,5,2,50),(135,1,1,50),(135,4,2,50)
SELECT * FROM #Temp
DROP TABLE #Temp
Below are the images of Input & Output i am trying to achieve, Can someone please help me with this

