Build SUM based daily record
- by ximarin
I have a problem building an aggregate function. Here's my problem:
I have a table like this
id action day isSum difference
1 ping 2012-01-01 1 500 (this is the sum of the differences from last year)
2 ping 2012-01-01 0 -2
3 ping 2012-01-02 0 1
4 ping 2012-01-03 0 -4
5 ping 2012-01-04 0 …