ソースコード
SELECT PREFECTURE.PF_CODE AS CODE, PF_NAME AS NAME, ROUND((DRINKER_NUM / TOTAL_NUM) * 100, 1) AS PERCENTAGE
FROM 
(SELECT PF_CODE, SUM(AMT) AS DRINKER_NUM
FROM DRINK_HABITS
WHERE CATEGORY_CODE = '120' 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 = '110' 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/22 12:07:38
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者ryota.k0112
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量99 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
99 MB
データパターン2
WA
96 MB