ソースコード
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 "都道府県コード"
ORDER BY "人口増加率" DESC, "都道府県コード"
;
提出情報
提出日時2023/07/15 23:40:31
コンテスト練習用コンテスト
問題人口増加率分析
受験者maskcott
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量78 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
78 MB
データパターン2
WA
76 MB