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 counted (title, copies) as (select distinct title, count(*) over (partition by title) as copies from film f join inventory i on f.film_id=i.film_id join rental r on i.inventory_id=r.inventory_id where year(rental_date)=2005 order by copies desc) select film_rank, title as film_rank from (select title, dense_rank() over (order by copies desc) as film_rank from counted) ranking where film_rank <=3 ; SHOW STATUS LIKE 'Last_query_cost';

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

Copy Clear