[Solved] need sum of value based on category [closed]
What you need is calculating rolling total. The fastest way in SQL Server 2005 / 2008 / 2008 R2 I know is described here: https://stackoverflow.com/a/13744550/1744834. You have to have unique secuential column inside each category to use this method, like this: create table #t (no int, category int, value int, id int, primary key (category, … Read more