[SQL문제풀기] 지역별 주문의 특징

silver's avatar
Sep 12, 2025
[SQL문제풀기] 지역별 주문의 특징
Contents
문제SQLite

문제

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

silver