Ok, I found something close, but it's for Oracle. So, just for reference -
https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9531712000346124348
Seems to be almost what I want. For example, row 2 should say 0 for the total, and row 3 should say -300, so offset by the previous...