ソースコード
select AG.AGE_NAME AS 年齢階層
    , sum(case when STD.TIME_CODE = 120 then STD.TARGET_POP else 0 end) AS '5時間未満'
    , sum(case when STD.TIME_CODE = 130 then STD.TARGET_POP else 0 end) AS '5時間以上6時間未満'
    , sum(case when STD.TIME_CODE = 140 then STD.TARGET_POP else 0 end) AS '6時間以上7時間未満'
    , sum(case when STD.TIME_CODE = 150 then STD.TARGET_POP else 0 end) AS '7時間以上8時間未満'
    , sum(case when STD.TIME_CODE = 160 then STD.TARGET_POP else 0 end) AS '8時間以上9時間未満'
    , sum(case when STD.TIME_CODE = 170 then STD.TARGET_POP else 0 end) AS '9時間以上'
    , sum(case when STD.TIME_CODE = 180 then STD.TARGET_POP else 0 end) AS '不詳'
from SLEEP_TIME_DTL AS STD
    inner join AGE_GRP AS AG
    on STD.AGE_CODE = AG.AGE_CODE
    inner join SLEEP_TIME AS ST
    on STD.TIME_CODE = ST.TIME_CODE
GROUP BY STD.AGE_CODE
ORDER BY STD.AGE_CODE ASC;
提出情報
提出日時2023/10/23 14:02:35
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者dmonika
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量77 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
77 MB
データパターン2
AC
75 MB