SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
with cte as (select a.film_id, b.customer_id, datediff(b.return_date,b.rental_date) as rt from rental b left join inventory a using(inventory_id)) select c.customer_id,c.rt, d.rental_duration from cte c left join film d using (film_id) where d.rental_duration>=c.rt; #select e.customer_id, e.rt, e.rental_duration, f.store_id from cte1 e #left join customer f on e.customer_id= f.customer_id ;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear