문제
SQLite
내가 작성한 정답
with a as (select region, category, count(distinct order_id) c
from records
group by region, category),
b as (select region,
case when category = 'Furniture' then c end f,
case when category = 'Office Supplies' then c end os,
case when category = 'Technology' then c end t
from a)
select region "Region", sum(f) "Furniture", sum(os) "Office Supplies",sum(t) "Technology"
from b
group by region;Share article