ソースコード
select 
SOSU.SCODE as CODE,
PREFECTURE.PF_NAME as NAME,
round(cast(MAINICHI.MSUMAMT as real)/ cast( SOSU.SSUMAMT as real) * 100, 2) as PERCENTAGE
from
(select 
PF_CODE as SCODE,
sum(AMT) as SSUMAMT
from DRINK_HABITS
where CATEGORY_CODE = '110'
and GENDER_CODE in ('2','3')
group by SCODE
) as SOSU left outer join
(select 
PF_CODE as MCODE,
sum(AMT) as MSUMAMT
from DRINK_HABITS
where CATEGORY_CODE = '120'
and GENDER_CODE in ('2','3')
group by MCODE
) as MAINICHI
on SOSU.SCODE = MAINICHI.MCODE
left outer join PREFECTURE
on SOSU.SCODE = PREFECTURE.PF_CODE
order by PERCENTAGE desc,
CODE desc;
提出情報
提出日時2022/09/21 13:59:59
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者shinki
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量95 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
95 MB
データパターン2
WA
94 MB