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 concat('[',result,']') as films_by_category from ( select GROUP_CONCAT('{', line, '}' SEPARATOR ', ') as result from ( select CONCAT( '"', category, '": ', most_rented_films ) as line from (select c.name as category,count(f.title) as most_rented_films from film f inner join film_category fc using(film_id) inner join category c using(category_id) group by c.name order by category ) as json_line ) as json_single_result ) as json_array ; show status like 'Last_query_cost';

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

Copy Clear