ソースコード
    WITH tbl AS (
        SELECT
            ag.AGE_NAME AS an,
            ag.AGE_CODE AS ac,
            st.TIME_CODE AS tc,
            sd.TARGET_POP AS tp
        FROM
            SLEEP_TIME_DTL AS sd
        LEFT JOIN
            AGE_GRP AS ag
            ON sd.AGE_CODE = ag.AGE_CODE
        LEFT JOIN
            SLEEP_TIME AS st
            ON sd.TIME_CODE = st.TIME_CODE
    )
    SELECT
        an AS '年齢階層',
        MAX(CASE WHEN tc = 120 THEN tp END) AS '5時間未満',
        MAX(CASE WHEN tc = 130 THEN tp END) AS '5時間以上6時間未満',
        MAX(CASE WHEN tc = 140 THEN tp END) AS '6時間以上7時間未満',
        MAX(CASE WHEN tc = 150 THEN tp END) AS '7時間以上8時間未満',
        MAX(CASE WHEN tc = 160 THEN tp END) AS '8時間以上9時間未満',
        MAX(CASE WHEN tc = 170 THEN tp END) AS '9時間以上',
        MAX(CASE WHEN tc = 180 THEN tp END) AS '不詳'
    FROM
        tbl
    GROUP BY
        an
    ORDER BY
        ac ASC
    ;
提出情報
提出日時2022/07/07 16:26:21
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者abes
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量79 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
79 MB
データパターン2
WA
79 MB