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 rental_date, IFNULL(return_date, CURRENT_TIMESTAMP) AS return_date, @prev_return := LAG(IFNULL(return_date, CURRENT_TIMESTAMP)) OVER (ORDER BY rental_date) AS prev_return FROM customer c left join inventory i ON c.store_id=i.store_id left join rental r ON r.inventory_id=i.inventory_id left join film f on i.film_id=f.film_id WHERE c.customer_id = 1

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

Copy Clear