ソースコード
SELECT
A.PF_CODE AS CODE,
C.PF_NAME AS NAME,
round(cast(ifnull(B.AMTIN,0) AS REAL)/cast(A.AMTALL AS REAL)*100,2) AS PERCENTAGE
FROM (SELECT PF_CODE,SUM(AMT) AS AMTALL FROM DRINK_HABITS WHERE GENDER_CODE in(2,3) AND CATEGORY_CODE = 110 GROUP BY PF_CODE) A
LEFT OUTER JOIN
(SELECT PF_CODE,SUM(AMT) AS AMTIN FROM DRINK_HABITS WHERE GENDER_CODE in(2,3) AND CATEGORY_CODE = 120 GROUP BY PF_CODE) B
ON A.PF_CODE = B.PF_CODE,
PREFECTURE C
where A.PF_CODE = C.PF_CODE
order by 3 desc, 1 desc
提出情報
提出日時2022/09/22 11:13:50
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者Clover
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量107 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
107 MB
データパターン2
WA
85 MB