ソースコード
select
d.pf_code as "CODE",
p.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 d
 inner join prefecture p
 on d.pf_code = p.pf_code
group by
 d.pf_code
order by
 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) desc,
 d.pf_code desc
提出情報
提出日時2022/09/22 01:49:51
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者Reliability
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量94 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
94 MB
データパターン2
AC
77 MB