Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
with a as(select film.title,film_category.category_id ,count(rental_id) c from film_category join film on film_category.film_id = film.film_id join inventory on film.film_id = inventory.film_id join rental on inventory.inventory_id = rental.inventory_id where year(rental_date) = '2005' group by film_category.film_id,film_category.category_id), b as (select * ,row_number() over (partition by category_id order by c desc) as a1 from a) select name as category,GROUP_CONCAT(title order by title) from b join category on b.category_id = category.category_id group by category,a1

Stuck with a problem? Got Error? Ask AI support!

Copy Clear