对于给定的EMI,P和R,如何求解“ N”?
也:
id principal_amount EMI rate
1 10000 5000 10.5
2 32000 8000 9.5
3 33000 9000 7
需要从公式中计算出“ N”并将其存储在表格中。
预期:
id principal_amount EMI rate N
1 10000 5000 10.5 calculate from formula
2 32000 8000 9.5 calculate from formula
3 33000 9000 7 calculate from formula
答案 0 :(得分:2)
只需对N进行算术求解,并使用标准log
函数即可获得算法:
select log(1 + rate, EMI / (EMI - principal_amount * rate )) AS N
from my_table;