ソースコード
select DISTINCT a.PF_CODE as CODE, PREFECTURE.PF_NAME as NAME, (ALL_TOTAL / DRINK_TOTAL* 100) as PERCENTAGE from DRINK_HABITS
 left join (select CATEGORY_CODE, PF_CODE, sum(AMT) as DRINK_TOTAL from DRINK_HABITS where CATEGORY_CODE = '120' and not GENDER_CODE = '1' group by PF_CODE) a on a.PF_CODE = DRINK_HABITS.PF_CODE
 left join (select CATEGORY_CODE, PF_CODE, sum(AMT) as ALL_TOTAL from DRINK_HABITS where CATEGORY_CODE = '110' and not GENDER_CODE = '1' group by PF_CODE) b on b.PF_CODE = DRINK_HABITS.PF_CODE
 left join PREFECTURE on PREFECTURE.PF_CODE = DRINK_HABITS.PF_CODE
 order by PERCENTAGE desc, PREFECTURE.PF_CODE desc;
提出情報
提出日時2022/09/21 21:38:30
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者chimayu
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量100 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
100 MB
データパターン2
WA
98 MB