ソースコード
SELECT
    E.SURVEY_YEAR AS SV_YEAR,
    P.PF_NAME AS PREFECTURE,
    CASE
        WHEN E.SUMA THEN '小学校'
        WHEN E.SUMB THEN '中学校'
        WHEN E.SUMC THEN '高校'
        WHEN E.SUMD THEN '短大'
        WHEN E.SUME THEN '大学'
        WHEN E.SUMF THEN '大学院'
        END AS KIND,

    CASE
        WHEN SUM(ELEMENTARY) THEN SUM(ELEMENTARY)
        WHEN SUM(MIDDLE) THEN SUM(MIDDLE)
        WHEN SUM(HIGH) THEN SUM(HIGH)
        WHEN SUM(JUNIOR_CLG) THEN SUM(JUNIOR_CLG)
        WHEN SUM(COLLEGE) THEN SUM(COLLEGE)
        WHEN SUM(GRADUATE) THEN SUM(GRADUATE)
        END AS AMT
FROM
    (
    SELECT
        SURVEY_YEAR,
        PF_CODE,
        SUM(ELEMENTARY) AS SUMA,
        SUM(MIDDLE) AS SUMB,
        SUM(HIGH) AS SUMC,
        SUM(JUNIOR_CLG) AS SUMD,
        SUM(COLLEGE) AS SMUE,
        SUM(GRADUATE) AS SUMF
    FROM
        ENROLLMENT_STATUS
    WHERE 
        SURVEY_YEAR = 2020
    GROUP BY
        SURVEY_YEAR,
        PF_CODE
    ) AS E
INNER JOIN
    PREFECTURE AS P
ON
    E.PF_CODE = P.PF_CODE
GROUP BY
    E.SURVEY_YEAR,
    P.PF_NAME,
    E.KIND
ORDER BY
    PREFECTURE ASC;
提出情報
提出日時2024/06/15 20:24:36
コンテスト第2回 SQLコンテスト
問題就学状況の表示変換
受験者muromati
状態 (詳細)RE
(Runtime Error: 実行時エラー)
メモリ使用量85 MB
メッセージ
SQLITE_ERROR: no such column: E.SUME
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
RE
85 MB
データパターン2
RE
84 MB