ソースコード
    SELECT 
      A.PF_CODE  AS CODE,
      PF_NAME   AS NAME,
    (
    round(100 * cast((SELECT SUM(AMT) FROM DRINK_HABITS AS C WHERE A.PF_CODE = C.PF_CODE AND CATEGORY_CODE = '120' GROUP BY C.PF_CODE) as REAL)
     / cast((SELECT SUM(AMT) FROM DRINK_HABITS AS D WHERE A.PF_CODE = D.PF_CODE AND CATEGORY_CODE = '110'GROUP BY D.PF_CODE) as REAL),
     
     1)
     ) AS PERCENTAGE
    FROM 
      DRINK_HABITS AS A
    INNER JOIN PREFECTURE AS B ON A.PF_CODE =  B.PF_CODE  
    WHERE 
      GENDER_CODE IN ('2', '3') AND CATEGORY_CODE != '130'
    GROUP BY A.PF_CODE
    ORDER BY PERCENTAGE DESC, A.PF_CODE DESC
     
提出情報
提出日時2022/09/22 02:52:29
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者tajima
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量86 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
83 MB
データパターン2
WA
86 MB