ソースコード
SELECT
    age_name AS '年齢階層',
    SUM(CASE WHEN time_code = 120 THEN target_pop ELSE 0 END) AS '5時間未満',
    SUM(CASE WHEN time_code = 130 THEN target_pop ELSE 0 END) AS '5時間以上6時間未満',
    SUM(CASE WHEN time_code = 140 THEN target_pop ELSE 0 END) AS '6時間以上7時間未満',
    SUM(CASE WHEN time_code = 150 THEN target_pop ELSE 0 END) AS '7時間以上8時間未満',
    SUM(CASE WHEN time_code = 160 THEN target_pop ELSE 0 END) AS '8時間以上9時間未満',
    SUM(CASE WHEN time_code = 170 THEN target_pop ELSE 0 END) AS '9時間以上',
    SUM(CASE WHEN time_code = 180 THEN target_pop ELSE 0 END) AS '不詳'
FROM
    sleep_time_dtl AS dtl
INNER JOIN
    age_grp USING (age_code)
INNER JOIN
    sleep_time USING (time_code)
GROUP BY
    age_code
ORDER BY
    age_code ASC;
提出情報
提出日時2023/04/14 12:05:21
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者naku6aru
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量78 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
78 MB
データパターン2
AC
76 MB