I need to fill field from sum of previous value. For example:
Id Price Total that i need
----------- ------------ ---------
1 500 500
2 200 500+200 = 700
3 NULL Because price is null put previous value = 700
4 300 SUM of previous row = 500+200+(calc to 700)+ 300 = 1700
5 NULL Because price is null put previous value = 1700
Please note that I can't use variable.
Also I am using sub-query, but does not work (only sum of price that is not null returned).
Can sql Update price real-time (record by record like cursor) ?