SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
select date, sales, rnk, sum(rnk) over (partition by date ROWS BETWEEN CURRENT ROW AND CURRENT ROW) rnk_sum 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
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear