I was trying to achieve the below result:
The logic for the 1st row is, ((470-375)/375)*100 If someone has idea about this please contribute.
You can use window function lead()
to retrieve the cumulative_excp
of the next record, and then use it in the computation:
select
run_date,
cumulative_excp,
100.0
* (lead(cumulative_excp) over(order by run_date) - cumulative_excp)
/ cumulative_excp interest
from mytable