ソースコード
SELECT "都道府県コード", "都道府県名", 
SUM(CASE WHEN "年" = 2015 THEN "総人口" ELSE 0 END) AS "総人口2015年",
SUM(CASE WHEN "年" = 2020 THEN "総人口" ELSE 0 END) AS "総人口2020年", 
ROUND(CAST(SUM(CASE WHEN "年" = 2020 THEN "総人口" ELSE 0 END) AS REAL)/CAST(SUM(CASE WHEN "年" = 2015 THEN "総人口" ELSE 0 END) AS REAL)*100) AS "人口増加率"
FROM (SELECT POP.SURVEY_YEAR AS "年", POP.PF_CODE AS "都道府県コード", PRE.PF_NAME AS "都道府県名", SUM(POP.TOTAL_AMT) AS "総人口"
FROM POPU_TRANSITION AS POP INNER JOIN PREFECTURE AS PRE on PRE.PF_CODE = POP.PF_CODE
GROUP BY POP.SURVEY_YEAR, POP.PF_CODE)
GROUP BY "都道府県コード"
HAVING "人口増加率" >= 100
ORDER BY "人口増加率" DESC, "都道府県コード"
;
提出情報
提出日時2023/07/15 23:51:05
コンテスト練習用コンテスト
問題人口増加率分析
受験者maskcott
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量79 MB
メッセージ
テストケース(通過数/総数)
1/2
状態
メモリ使用量
データパターン1
WA
79 MB
データパターン2
AC
79 MB