inblog logo
|
silver
    SQL문제풀기

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

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

    문제

    solvesql.com
    solvesql.com
    https://solvesql.com/problems/summary-of-artworks-in-3-years/

    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

    RSS·Powered by Inblog