ソースコード
SELECT T1.PF_CODE AS CODE, PF_NAME AS NAME, (DRINKER_NUM / TOTAL_NUM) AS PERCENTAGE
FROM (
    SELECT PF_CODE, SUM(AMT) AS DRINKER_NUM
    FROM DRINK_HABITS
    WHERE CATEGORY_CODE = '110' AND GENDER_CODE != '1'
    GROUP BY PF_CODE
    ) AS T1
LEFT JOIN (
    SELECT PF_CODE, SUM(AMT) AS TOTAL_NUM
    FROM DRINK_HABITS
    WHERE CATEGORY_CODE = '120' AND GENDER_CODE != '1'
    GROUP BY PF_CODE
) AS T2
ON T1.PF_CODE = T2.PF_CODE
LEFT JOIN PREFECTURE ON T1.PF_CODE = PREFECTURE.PF_CODE;
提出情報
提出日時2022/09/21 22:17:15
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者ryota.k0112
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量102 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
102 MB
データパターン2
WA
101 MB