ソースコード
select 
	DRINK_HABITS.PF_CODE as CODE
	,PREFECTURE.PF_NAME as NAME
	,round(cast(sum(case when CATEGORY_CODE = '120' and GENDER_CODE in ('2','3') then AMT else 0 end) as real)
		/ cast(sum(case when CATEGORY_CODE = '110' and GENDER_CODE in ('2','3') then AMT else 0 end) as real)
		 * 100,1) as PERCENTAGE
from DRINK_HABITS 
inner join PREFECTURE on DRINK_HABITS.PF_CODE = PREFECTURE.PF_CODE
group by DRINK_HABITS.PF_CODE
order by PERCENTAGE desc, CODE desc;
提出情報
提出日時2022/09/21 21:59:07
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者turty000
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量98 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
98 MB
データパターン2
AC
94 MB