SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
select i.film_id, i.store_id, datediff(lead(r.rental_date) over(partition by i.store_id, i.film_id order by r.rental_date asc), r.return_date) as diff from rental r inner join inventory i on r.inventory_id = i.inventory_id order by i.film_id asc

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear