SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
with t1 as (select store_id,datediff(return_date,rental_date)delayed_count, f.rental_duration from rental r join inventory i on r.inventory_id = i.inventory_id join film f on i.film_id = f.film_id group by store_id,datediff(return_date,rental_date),rental_duration ) select distinct store_id, delayed_count from t1 where rental_duration > delayed_count group by store_id,delayed_count

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear