[Input: sakila.payment]

[Problem]
[Output]

[Answer]
select t.dt
,t.monthly_amount
,sum(t.monthly_amount) over (partition by month(t.dt) order by t.dt asc rows ㅠbetween unbounded preceding and current row) as accu_monthly_amount
from (
select date(payment_date) as dt
,sum(amount) as monthly_amount
from payment
where date_format(payment_date, "%Y%m") in ('200505', '200506')
group by date(payment_date)
) t;