SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
explain analyze select film_id, title , sum(store_id = 1) store_1_count , sum(store_id = 2) store_2_count , count(inventory_id) total_count from film join inventory using(film_id) group by film_id, title order by title; SHOW STATUS LIKE 'Last_query_cost'; -- explain analyze select F.film_id, title, count(case when store_id = 1 then film_id end) store_1_count, count(case when store_id = 2 then film_id end) store_2_count, count(F.film_id) total_count from film F join inventory I using (film_id) group by F.film_id, title order by film_id; SHOW STATUS LIKE 'Last_query_cost';
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear