Hi,
Can you pls advice how to achieve the below kind of scenario in T-SQL ?
--------
Initial_Value | Used_Value | Balance |
20 | 0 | 20 |
1 | 19 (=20-1) | |
1 | 18 (=19-1) | |
2 | 16 (=18-2) |
As every time it calculates the "Balance" part which is my final output it should subtract the "Used_Value" from the previous calculated "Balance"
How can I achieve this (to include it in my stored proc to calculate "Balance" part)
Thanks