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 sov as (select film_id, count(film_id) store_1_count from inventory where store_id=1 group by film_id), mov as (select film_id, count(film_id) store_2_count from inventory where store_id=2 group by film_id), gov as (select film_id, count(film_id) total_count from inventory group by film_id) select sov.film_id, store_1_count, store_2_count, total_count from sov join mov on sov.film_id=mov.film_id join gov on mov.film_id=sov.film_id

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

Copy Clear