ソースコード
SELECT
    AGE_NAME AS 年齢階層,
    T5.TN AS '5時間未満',
    T56.TN AS '5時間以上6時間未満',
    T67.TN AS '6時間以上7時間未満',
    T78.TN AS '7時間以上8時間未満',
    T89.TN AS '8時間以上9時間未満',
    T9.TN AS '9時間以上',
    UNKWON.TN AS 不詳
FROM AGE_GRP AS A
LEFT JOIN (
    SELECT *, SUM(TARGET_POP) AS TN
    FROM SLEEP_TIME_DTL AS STD
    LEFT JOIN SLEEP_TIME AS ST ON STD.TIME_CODE = ST.TIME_CODE
    WHERE STD.TIME_CODE=120
    GROUP BY AGE_CODE
) AS T5 ON A.AGE_CODE = T5.AGE_CODE
LEFT JOIN (
    SELECT AGE_CODE, SUM(TARGET_POP) AS TN
    FROM SLEEP_TIME_DTL AS STD
    LEFT JOIN SLEEP_TIME AS ST ON STD.TIME_CODE = ST.TIME_CODE
    WHERE STD.TIME_CODE=130
    GROUP BY AGE_CODE
) AS T56 ON A.AGE_CODE = T56.AGE_CODE
LEFT JOIN (
    SELECT AGE_CODE, SUM(TARGET_POP) AS TN
    FROM SLEEP_TIME_DTL AS STD
    LEFT JOIN SLEEP_TIME AS ST ON STD.TIME_CODE = ST.TIME_CODE
    WHERE STD.TIME_CODE=140
    GROUP BY AGE_CODE
) AS T67 ON A.AGE_CODE = T67.AGE_CODE
LEFT JOIN (
    SELECT AGE_CODE, SUM(TARGET_POP) AS TN
    FROM SLEEP_TIME_DTL AS STD
    LEFT JOIN SLEEP_TIME AS ST ON STD.TIME_CODE = ST.TIME_CODE
    WHERE STD.TIME_CODE=150
    GROUP BY AGE_CODE
) AS T78 ON A.AGE_CODE = T78.AGE_CODE
LEFT JOIN (
    SELECT AGE_CODE, SUM(TARGET_POP) AS TN
    FROM SLEEP_TIME_DTL AS STD
    LEFT JOIN SLEEP_TIME AS ST ON STD.TIME_CODE = ST.TIME_CODE
    WHERE STD.TIME_CODE=160
    GROUP BY AGE_CODE
) AS T89 ON A.AGE_CODE = T89.AGE_CODE
LEFT JOIN (
    SELECT AGE_CODE, SUM(TARGET_POP) AS TN
    FROM SLEEP_TIME_DTL AS STD
    LEFT JOIN SLEEP_TIME AS ST ON STD.TIME_CODE = ST.TIME_CODE
    WHERE STD.TIME_CODE=170
    GROUP BY AGE_CODE
) AS T9 ON A.AGE_CODE = T9.AGE_CODE
LEFT JOIN (
    SELECT AGE_CODE, SUM(TARGET_POP) AS TN
    FROM SLEEP_TIME_DTL AS STD
    LEFT JOIN SLEEP_TIME AS ST ON STD.TIME_CODE = ST.TIME_CODE
    WHERE STD.TIME_CODE=180
    GROUP BY AGE_CODE
) AS UNKWON ON A.AGE_CODE = UNKWON.AGE_CODE
提出情報
提出日時2023/08/20 04:43:02
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者leo
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量80 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
80 MB
データパターン2
WA
78 MB