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 distinct c.customer_id -- , c.first_name -- , c.last_name -- , CEIL(AVG(TIMESTAMPDIFF(DAY, rental_date, return_date))) average_rental_time -- FROM rental r -- left JOIN sakila.customer c -- ON c.customer_id = r.customer_id -- GROUP BY c.customer_id -- ORDER BY 1; select rental_id, CEIL(AVG(TIMESTAMPDIFF(DAY, rental_date, return_date))) average_rental_time from rental group by 1

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

Copy Clear