SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
with cte as ( select json_object(c.name, count(fc.film_id)) as cnt from category c inner join film_category fc on fc.category_id = c.category_id group by c.name) select json_arrayagg(cnt) as films_by_category from cte ; show status like 'Last_query_cost';

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear