ソースコード
-- https://topsic-contest.jp/contests/practice/problems/practice003


select
    pref.pf_code as 都道府県コード, pref.pf_name as 都道府県名,
    sum( case when pop.survey_year = 2015 then pop.total_amt else null end) as 総人口2015年,
    sum( case when pop.survey_year = 2020 then pop.total_amt else null end) as 総人口2020年,
    round(cast(
        cast(sum( case when pop.survey_year = 2020 then pop.total_amt else null end) as float)/
        cast(sum( case when pop.survey_year = 2015 then pop.total_amt else null end) as float)
     as float), 2) as 人口増加率
from
    popu_transition as pop
left join 
    PREFECTURE as pref
on pop.pf_code = pref.pf_code
group by 
    pref.pf_code, pref.pf_name
    order by 
round(cast(
        cast(sum( case when pop.survey_year = 2020 then pop.total_amt else null end) as float)/
        cast(sum( case when pop.survey_year = 2015 then pop.total_amt else null end) as float)
     as float), 2)  desc, pref.pf_code
提出情報
提出日時2022/09/16 14:16:01
コンテスト練習用コンテスト
問題人口増加率分析
受験者kokiando
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量77 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
77 MB
データパターン2
WA
76 MB