Skip to content
Advertisement

Find Interest rate on account statement in sql

i hava table of statement and it has the date,credit,debit and balance column through these i want to find total interest.

for finding interest :

  1. if count_day=next_date-current_date then
  2. (4*(sum(count*bal)))/36500

I tried and get row of each trx interest but didn’t get total or sum of the rows. and while trying sum() on the query error shows ORA-30483: window functions are not allowed here

Advertisement

Answer

Here is my solution using LEAD

This gives an accrued interest of 62.79 for the sample data. Below are the individual interest amounts

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement