ソースコード
select a.PF_CODE as CODE, PREFECTURE.PF_NAME as NAME, round(cast(DRINK_TOTAL as real) / cast(ALL_TOTAL as real) * 100, 1) as PERCENTAGE from PREFECTURE
 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 = PREFECTURE.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 = PREFECTURE.PF_CODE
 order by PERCENTAGE desc, PREFECTURE.PF_CODE desc;
提出情報
提出日時2022/09/21 22:14:30
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者chimayu
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量102 MB
メッセージ
テストケース(通過数/総数)
1/2
状態
メモリ使用量
データパターン1
AC
102 MB
データパターン2
WA
101 MB