ソースコード
select dr.PF_CODE as CODE
       , pr.PF_NAME as NAME
       , round(cast(oo.合計 as REAL )/cast(gg.合計 as REAL)* 100,1) AS PERCENTAGE
    
from DRINK_HABITS as dr
LEFT join PREFECTURE as pr
on dr.PF_CODE = pr.PF_CODE

INNER JOIN (select sum(AMT) AS 合計
                   ,PF_CODE
            FROM DRINK_HABITS
            where CATEGORY_CODE = '110'
            and GENDER_CODE <> '1'
            group by PF_CODE)AS gg
        ON gg.PF_CODE = dr.PF_CODE 
        
INNER JOIN (select sum(AMT) AS 合計
                   ,PF_CODE
            FROM DRINK_HABITS
            where CATEGORY_CODE = '120'
            and GENDER_CODE <> '1'
            group by PF_CODE)AS oo
        ON oo.PF_CODE = dr.PF_CODE 
        
group by dr.PF_CODE 
       , pr.PF_NAME 
order by dr.PF_CODE desc,CODE desc
提出情報
提出日時2022/09/21 18:16:42
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者morbol_king
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量97 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
97 MB
データパターン2
WA
95 MB