SELECT MONTH(Month) AS Month , SUM(vlera) AS Value , SUM(0) AS [Don't know how to do] FROM dbo.tblTest GROUP BY MONTH(Month)
Month Value Don't know how to do ----------- ------------- -------------------- 1 12.50 0 2 12.50 0 3 12.50 0 4 13.00 0
12.5 25 37.5 50.5
SELECT t.Month AS Month , t.vlera AS Value , tt.column_total AS [sub total] FROM dbo.tblTest t cross apply (select sum(vlera) as column_total from tblTest ) as tt ORDER BY t.Month
SELECT a.month, a.value, SUM(b.value) as cumulativesum FROM #temp a, #temp b where (b.month <= a.month) GROUP BY a.month,a.value
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)