ソースコード
select AGE_GRP.AGE_NAME as '年齢階層',
       TIME120.SUMPOP as '5時間未満',
       TIME130.SUMPOP as '5時間以上6時間未満',
       TIME140.SUMPOP as '6時間以上7時間未満',
       TIME150.SUMPOP as '7時間以上8時間未満',
       TIME160.SUMPOP as '8時間以上9時間未満',
       TIME170.SUMPOP as '9時間以上',
       TIME180.SUMPOP as '不詳'
  from AGE_GRP
 inner join 
       (select AGE_CODE,TIME_CODE,sum(TARGET_POP) as SUMPOP
          from SLEEP_TIME_DTL
         where TIME_CODE = 120
         group by AGE_CODE,TIME_CODE) TIME120
    on AGE_GRP.AGE_CODE = TIME120.AGE_CODE
 inner join 
       (select AGE_CODE,TIME_CODE,sum(TARGET_POP) as SUMPOP
          from SLEEP_TIME_DTL
         where TIME_CODE = 130
         group by AGE_CODE,TIME_CODE) TIME130
    on AGE_GRP.AGE_CODE = TIME130.AGE_CODE
 inner join 
       (select AGE_CODE,TIME_CODE,sum(TARGET_POP) as SUMPOP
          from SLEEP_TIME_DTL
         where TIME_CODE = 140
         group by AGE_CODE,TIME_CODE) TIME140
    on AGE_GRP.AGE_CODE = TIME140.AGE_CODE
 inner join 
       (select AGE_CODE,TIME_CODE,sum(TARGET_POP) as SUMPOP
          from SLEEP_TIME_DTL
         where TIME_CODE = 150
         group by AGE_CODE,TIME_CODE) TIME150
    on AGE_GRP.AGE_CODE = TIME150.AGE_CODE
 inner join 
       (select AGE_CODE,TIME_CODE,sum(TARGET_POP) as SUMPOP
          from SLEEP_TIME_DTL
         where TIME_CODE = 160
         group by AGE_CODE,TIME_CODE) TIME160
    on AGE_GRP.AGE_CODE = TIME160.AGE_CODE
 inner join 
       (select AGE_CODE,TIME_CODE,sum(TARGET_POP) as SUMPOP
          from SLEEP_TIME_DTL
         where TIME_CODE = 170
         group by AGE_CODE,TIME_CODE) TIME170
    on AGE_GRP.AGE_CODE = TIME170.AGE_CODE
 inner join 
       (select AGE_CODE,TIME_CODE,sum(TARGET_POP) as SUMPOP
          from SLEEP_TIME_DTL
         where TIME_CODE = 180
         group by AGE_CODE,TIME_CODE) TIME180
    on AGE_GRP.AGE_CODE = TIME180.AGE_CODE
 order by AGE_GRP.AGE_CODE

提出情報
提出日時2022/11/09 17:09:24
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者gomitaka
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量82 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
82 MB
データパターン2
AC
78 MB