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
SELECT film_rank, film_title FROM (SELECT DENSE_RANK() OVER (ORDER BY COUNT(rental_id) DESC) AS film_rank, title as film_title FROM rental JOIN inventory USING(inventory_id) JOIN film USING(film_id) WHERE rental_date LIKE '2005%' GROUP BY title) AS ranked_films WHERE film_rank <= 3 ORDER BY film_rank, film_title

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

Copy Clear