Home Forums SQL Server 2008 T-SQL (SS2K8) How to add up the monthly total? RE: How to add up the monthly total?
SQLCJ
SSCommitted
Points: 1781
More actions
March 7, 2014 at 10:53 am
#1695190
select date_value,monthly_total,(select sum(monthly_total) from sales s where date_value <= tst.date_value )
monthly_total_sum from
(
select *,ROW_NUMBER() over ( order by date_value )tst from sales
)tst order by date_value