ソースコード
with drink as (
    select
        PF_CODE,
        CATEGORY_CODE,
        AMT
    from
        DRINK_HABITS
    where
        GENDER_CODE != "1"
    and
        CATEGORY_CODE = 120
    group by
        PF_CODE,
        CATEGORY_CODE
)

select
    p.PF_CODE as CODE,
    p.PF_NAME as NAME,
    round(100 * cast(d2.AMT as real)/cast(d.AMT as real),2) as PERCENTAGE
from
    PREFECTURE as p
join
    DRINK_HABITS as d on d.PF_CODE = p.PF_CODE
join
    drink as d2 on d2.PF_CODE = p.PF_CODE
where
    d.GENDER_CODE != "1"
and
    d.CATEGORY_CODE = 110
group by
    CODE,d.CATEGORY_CODE
order by
    PERCENTAGE desc,
    CODE desc
提出情報
提出日時2023/07/12 21:33:28
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者Ginobirian20
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量79 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
79 MB
データパターン2
WA
78 MB