Если вы используете MySQL 8.0, вы можете использовать рекурсивный запрос для этого:
with recursive cte as (
select
start_dt,
end_dt,
dur_of_months,
1 lvl,
amount initial_amount,
amount
from mytable
union all
select
start_dt + interval 1 month,
end_dt,
dur_of_months,
lvl + 1,
initial_amount,
initial_amount * (1 - lvl / dur_of_months)
from cte
where start_dt < end_dt
)
select date_format(start_dt, '%M %Y') mon_dt, amount from cte order by start_dt
Демонстрация на DB Fiddle :
| mon_dt | amount |
| ------------- | ------ |
| January 2020 | 800 |
| February 2020 | 600 |
| March 2020 | 400 |
| April 2020 | 200 |
В более ранних версиях, начиная с существующего запроса, вы могли бы сделать:
select
date_format(start_dt + interval n.n month, '%M %Y') as mon_dt,
amount * (1 - n / dur_of_months) amount
from mytable
join (
select n10.n * 10 + n1.n * 1 as n
from (
select 0 n union all select 1 union all select 2 union all select 3
union all select 4 union all select 5 union all select 6
union all select 7 union all select 8 union all select 9
) n10
cross join (
select 0 n union all select 1 union all select 2 union all select 3
union all select 4 union all select 5 union all select 6
union all select 7 union all select 8 union all select 9
) n1
) n on start_dt + interval n.n month <= end_dt
order by start_dt + interval n.n month
Демо