ソースコード

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'
AND GENDER_CODE IN ('2', '3') AND CATEGORY_CODE != '130') as REAL)
 / cast((SELECT SUM(AMT) FROM DRINK_HABITS AS D WHERE A.PF_CODE = D.PF_CODE AND CATEGORY_CODE = '110'
 AND GENDER_CODE IN ('2', '3') AND CATEGORY_CODE != '130') as REAL), 1)
 ) AS PERCENTAGE
FROM 
  DRINK_HABITS AS A
INNER JOIN PREFECTURE AS B ON A.PF_CODE =  B.PF_CODE  
WHERE 
  1
GROUP BY A.PF_CODE
ORDER BY PERCENTAGE DESC, A.PF_CODE ASC
提出情報
提出日時2022/09/22 02:42:24
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者tajima
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量80 MB
メッセージ
テストケース(通過数/総数)
1/2
状態
メモリ使用量
データパターン1
WA
80 MB
データパターン2
AC
77 MB