ソースコード
select ag.AGE_NAME as "年齢階層"
      ,tmp1.sum_TARGET_POP1 as "5時間未満"
      ,tmp2.sum_TARGET_POP2 as "5時間以上6時間未満"
      ,tmp3.sum_TARGET_POP3 as "6時間以上7時間未満"
      ,tmp4.sum_TARGET_POP4 as "7時間以上8時間未満"
      ,tmp5.sum_TARGET_POP5 as "8時間以上9時間未満"
      ,tmp6.sum_TARGET_POP6 as "9時間以上"
      ,tmp7.sum_TARGET_POP7 as "不詳"
from AGE_GRP ag,
( select AGE_CODE,SUM(TARGET_POP) sum_TARGET_POP1
  from   SLEEP_TIME_DTL
  where  TIME_CODE = 120
  group by AGE_CODE ) tmp1,
( select AGE_CODE, SUM(TARGET_POP) sum_TARGET_POP2
  from   SLEEP_TIME_DTL
  where  TIME_CODE = 130
  group by AGE_CODE ) tmp2,
( select AGE_CODE, SUM(TARGET_POP) sum_TARGET_POP3
  from   SLEEP_TIME_DTL
  where  TIME_CODE = 140
  group by AGE_CODE ) tmp3,
( select AGE_CODE, SUM(TARGET_POP) sum_TARGET_POP4
  from   SLEEP_TIME_DTL
  where  TIME_CODE = 150
  group by AGE_CODE ) tmp4,
( select AGE_CODE, SUM(TARGET_POP) sum_TARGET_POP5
  from   SLEEP_TIME_DTL
  where  TIME_CODE = 160
  group by AGE_CODE ) tmp5,
( select AGE_CODE, SUM(TARGET_POP) sum_TARGET_POP6
  from   SLEEP_TIME_DTL
  where  TIME_CODE = 170
  group by AGE_CODE ) tmp6,
( select AGE_CODE, (TARGET_POP) sum_TARGET_POP7
  from   SLEEP_TIME_DTL
  where  TIME_CODE = 180
  group by AGE_CODE ) tmp7
where ag.AGE_CODE = tmp1.AGE_CODE
and   ag.AGE_CODE = tmp2.AGE_CODE
and   ag.AGE_CODE = tmp3.AGE_CODE
and   ag.AGE_CODE = tmp4.AGE_CODE
and   ag.AGE_CODE = tmp5.AGE_CODE
and   ag.AGE_CODE = tmp6.AGE_CODE
and   ag.AGE_CODE = tmp7.AGE_CODE
order by ag.AGE_CODE
;
提出情報
提出日時2022/09/20 17:55:22
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者sho
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量79 MB
メッセージ
テストケース(通過数/総数)
1/2
状態
メモリ使用量
データパターン1
WA
79 MB
データパターン2
AC
77 MB