Reputation: 839
How to solve 'N' for given EMI, P & R?
Also:
id principal_amount EMI rate
1 10000 5000 10.5
2 32000 8000 9.5
3 33000 9000 7
Need to calculate 'N' from the formula and have it in a table.
Expected:
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
Upvotes: 0
Views: 226
Reputation: 7825
Just arithmetically solve the equation against N and use standard log
function to get the algorithm:
select log(1 + rate, EMI / (EMI - principal_amount * rate )) AS N
from my_table;
Upvotes: 2