0
我想在这里做的是计算在我的交易表中有涉及以下领域的所有行的平衡:计算所有行的资产负债
deposit
,withdraw
,monthly interest paid
从这些,我然后计算在使用此代码行balance
的末尾:
select transaction_Id, o.amount_deposited, o.amount_withdraw, o.Interest_recived,
(select (sum(amount_deposited) - o.amount_withdraw + (o.Interest_recived))
from transactionn where transaction_Id <= o.transaction_Id)
'Balance'
from transactionn o
但是,输出不是我想要的。
你想运行总计?是否有多个帐户或一个帐户? – Yuck
输出有什么问题? – thekip
你不需要提款的总和吗? – V4Vendetta