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 c.first_name, c.last_name, c.email, a.address FROM ( SELECT r.*, ROW_NUMBER() OVER (PARTITION BY r.inventory_id ORDER BY r.rental_date DESC) AS row_number FROM rental r WHERE r.inventory_id = 30 ) AS rental_inv JOIN customer c ON rental_inv.customer_id = c.customer_id JOIN address a ON c.address_id = a.address_id WHERE rental_inv.row_number = 1; ; show status like 'Last_query_cost';

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

Copy Clear