SQL Server Multiple Running Totals

Posted by Nai on Stack Overflow See other posts from Stack Overflow or by Nai
Published on 2010-05-11T16:08:09Z Indexed on 2010/05/11 16:14 UTC
Read the original article Hit count: 239

Filed under:
|

I have a table like this

UserID  Score  Date
5       6      2010-1-1
7       8      2010-1-2
5       4      2010-1-3
6       3      2010-1-4
7       4      2010-1-5
6       1      2010-1-6

I would like to get a table like this

UserID  Score  RunningTotal Date
5       6      6            2010-1-1
5       4      10           2010-1-3
6       3      3            2010-1-4
6       1      4            2010-1-6
7       8      8            2010-1-2
7       4      12           2010-1-5

Thanks!

© Stack Overflow or respective owner

Related posts about sql-server-2008

Related posts about tsql