表 1:用户管理员
uid uname
1 abc
2 xyz
3 pqr
4 def
表 2:事务主管
tid uid amount type
1 1 100 1
2 2 500 1
2 2 500 2
3 1 350 1
3 1 150 2
输入事务表:
1 for capital
2 for interest(5% of total capital)
现在,我想计算interest
每个月的资本金额和资本价值 5% 的广告利息。应通过查询:自动为有资金的两个用户在表中添加利息条目transactionmaster
。
transactionmaster
结果在表中应该是这样的。
tid uid amount type
1 1 100 1
2 2 500 1
3 1 600 1
4 1 35 2
5 2 25 2
这里interest
也自动算5%。