[Solved] Cummulative SUM based on columns
No need to make thinks more complicated than they need to be… IF OBJECT_ID(‘tempdb..#TestData’, ‘U’) IS NOT NULL DROP TABLE #TestData; CREATE TABLE #TestData ( ID INT NOT NULL, [Year] INT NOT NULL ); INSERT #TestData (ID, Year) VALUES (1, 2010), (1, 2010), (2, 2010), (2, 2011), (3, 2012), (4, 2013), (5, 2014), (5, 2014), … Read more