SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
with a as (select count(*) as aa,title from rental join inventory on rental.inventory_id = inventory.inventory_id join film on inventory.film_id = film.film_id group by title) select DENSE_RANK() OVER(/*PARTITION BY title*/ ORDER BY aa desc) as film_rank ,title as film_title,aa from a order by film_rank,film_title asc

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear