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 table_res.title, table_res.first_cus as first_customer FROM (SELECT f.title, CONCAT(c.first_name, ' ', c.last_name) as first_cus, FIRST_VALUE(f.title) OVER(PARTITION BY r.rental_date) as first_rent FROM film f INNER JOIN film_category f_c ON f.film_id = f_c.film_id INNER JOIN category cat ON f_c.category_id = cat.category_id INNER JOIN inventory i ON f.film_id = i.film_id INNER JOIN rental r ON i.inventory_id = r.inventory_id INNER JOIN customer c ON r.customer_id = c.customer_id WHERE c.active = 1 AND cat.name = 'Horror' AND f.rating = 'PG-13') as table_res ORDER BY table_res.title

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

Copy Clear