ソースコード
select
    AG.AGE_NAME as 年齢階層
    , STD_5.TTP as '5時間未満'
    , STD_56.TTP as '5時間以上6時間未満'
    , STD_67.TTP as '6時間以上7時間未満'
    , STD_78.TTP as '7時間以上8時間未満'
    , STD_89.TTP as '8時間以上9時間未満'
    , STD_9.TTP as '9時間以上'
    , STD_X.TTP as '不詳'
from
    AGE_GRP as AG
join (select AGE_CODE, sum(TARGET_POP) as TTP from SLEEP_TIME_DTL where TIME_CODE = 120 group by 1) as STD_5 on STD_5.AGE_CODE = AG.AGE_CODE
join (select AGE_CODE, sum(TARGET_POP) as TTP from SLEEP_TIME_DTL where TIME_CODE = 130 group by 1) as STD_56 on STD_56.AGE_CODE = AG.AGE_CODE
join (select AGE_CODE, sum(TARGET_POP) as TTP from SLEEP_TIME_DTL where TIME_CODE = 140 group by 1) as STD_67 on STD_67.AGE_CODE = AG.AGE_CODE
join (select AGE_CODE, sum(TARGET_POP) as TTP from SLEEP_TIME_DTL where TIME_CODE = 150 group by 1) as STD_78 on STD_78.AGE_CODE = AG.AGE_CODE
join (select AGE_CODE, sum(TARGET_POP) as TTP from SLEEP_TIME_DTL where TIME_CODE = 160 group by 1) as STD_89 on STD_89.AGE_CODE = AG.AGE_CODE
join (select AGE_CODE, sum(TARGET_POP) as TTP from SLEEP_TIME_DTL where TIME_CODE = 170 group by 1) as STD_9 on STD_9.AGE_CODE = AG.AGE_CODE
join (select AGE_CODE, sum(TARGET_POP) as TTP from SLEEP_TIME_DTL where TIME_CODE = 180 group by 1) as STD_X on STD_X.AGE_CODE = AG.AGE_CODE
order by AG.AGE_CODE
提出情報
提出日時2022/07/05 13:00:14
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者mamao
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量80 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
80 MB
データパターン2
AC
79 MB