ソースコード
SELECT
 x.SURVEY_YEAR as SV_YEAR
 ,p.PF_NAME as PREFECTURE
 ,(CASE
    WHEN x.s1 is not null THEN "小学校"
    WHEN x.s2 is not null THEN "中学校"
    WHEN x.s3 is not null THEN "高校"
    WHEN x.s4 is not null THEN "短大"
    WHEN x.s5 is not null THEN "大学"
    WHEN x.s6 is not null THEN "大学院"
   END) AS KIND
 ,(CASE
    WHEN x.s1 is not null THEN x.s1
    WHEN x.s2 is not null THEN x.s2
    WHEN x.s3 is not null THEN x.s3
    WHEN x.s4 is not null THEN x.s4
    WHEN x.s5 is not null THEN x.s5
    WHEN x.s6 is not null THEN x.s6
   END) AS AMT
FROM
 (
  select
   SURVEY_YEAR
   ,PF_CODE
   ,sum(ELEMENTARY) as s1
   ,sum(MIDDLE) as s2
   ,sum(HIGH) as s3
   ,sum(JUNIOR_CLG) as s4
   ,sum(COLLEGE) as s5
   ,sum(GRADUATE) as s6
  from ENROLLMENT_STATUS
  where SURVEY_YEAR=2020
  group by PF_CODE
  ) x
 INNER JOIN
 PREFECTURE p
 ON x.PF_CODE = p.PF_CODE
ORDER BY
 x.PF_CODE
提出情報
提出日時2022/09/21 15:58:31
コンテスト第2回 SQLコンテスト
問題就学状況の表示変換
受験者na1216
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量96 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
93 MB
データパターン2
WA
96 MB