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
with custs as( select customer_id,count(rental_id) as rent_ct from rental group by customer_id having count(rental_id) > (select count(rental_id)/count(distinct customer_id) from rental) ) select t1.customer_id, t2.first_name,t2.last_name, t1.rent_ct from custs t1 join customer t2 on t1.customer_id = t2.customer_id; ; show status like 'Last_query_cost';

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

Copy Clear