select
distinct
date,
max(sales) over (partition by date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) field
from (select date, sales, dense_rank() over(order by date) rnk from (select *
from(select count(inventory_id) as sales, date_format(rental_date,'%M') as date
from rental
group by date_format(rental_date,'%M')
order by date_format(rental_date,'%M') asc) gg
union all
select *
from(select count(inventory_id) as sales, date_format(rental_date,'%M') as date
from rental
group by date_format(rental_date,'%M')
order by date_format(rental_date,'%M') asc) gg
union all
select *
from(select count(inventory_id) as sales, date_format(rental_date,'%M') as date
from rental
group by date_format(rental_date,'%M')
order by date_format(rental_date,'%M') asc) gg) ff) tt