我在我的數據庫表中的以下記錄:計算平衡
Date Credit Debit Description
--------------- ------- ------- ---------------
12-24-2015 5 Purchased credit
12-20-2015 1 Consumed credit
12-15-2015 3 Purchased credit
12-08-2015 1 Consumed credit
12-08-2015 1 Consumed credit
12-07-2015 1 Consumed credit
12-04-2015 1 Consumed credit
12-03-2015 1 Consumed credit
12-01-2015 5 Purchased credit
我想要計算並顯示每個記錄的餘額如下圖所示:
Date Credit Debit Balance Description
------------ ------- ------- ------- ---------------
12-24-2015 5 0 7 Purchased credit
12-20-2015 1 2 Consumed credit
12-15-2015 3 0 3 Purchased credit
12-08-2015 1 0 Consumed credit
12-08-2015 1 1 Consumed credit
12-07-2015 1 2 Consumed credit
12-04-2015 1 3 Consumed credit
12-03-2015 1 4 Consumed credit
12-01-2015 5 0 5 Purchased credit
能任何人都可以幫助我實現上述結果?
它已經張貼在的問題。第一部分顯示可用數據,第二部分顯示預期結果 –