ソースコード
select 
AGE_NAME as "年齢階層",
tc120.pop as "5時間未満",
tc130.pop as "5時間以上6時間未満",
tc140.pop as "6時間以上7時間未満",
tc150.pop as "7時間以上8時間未満",
tc160.pop as "8時間以上9時間未満",
tc170.pop as "9時間以上",
tc180.pop as "不詳"
from (
  select AGE_CODE, sum(TARGET_POP) as pop from SLEEP_TIME_DTL
  where TIME_CODE = 120
  group by AGE_CODE
) as tc120
inner join (
  select AGE_CODE, sum(TARGET_POP) as pop from SLEEP_TIME_DTL
  where TIME_CODE = 130
  group by AGE_CODE
) as tc130
on tc120.AGE_CODE = tc130.AGE_CODE
inner join (
  select AGE_CODE, sum(TARGET_POP) as pop from SLEEP_TIME_DTL
  where TIME_CODE = 140
  group by AGE_CODE
) as tc140
on tc120.AGE_CODE = tc140.AGE_CODE
inner join (
  select AGE_CODE, sum(TARGET_POP) as pop from SLEEP_TIME_DTL
  where TIME_CODE = 150
  group by AGE_CODE
) as tc150
on tc120.AGE_CODE = tc150.AGE_CODE
inner join (
  select AGE_CODE, sum(TARGET_POP) as pop from SLEEP_TIME_DTL
  where TIME_CODE = 160
  group by AGE_CODE
) as tc160
on tc120.AGE_CODE = tc160.AGE_CODE
inner join (
  select AGE_CODE, sum(TARGET_POP) as pop from SLEEP_TIME_DTL
  where TIME_CODE = 170
  group by AGE_CODE
) as tc170
on tc120.AGE_CODE = tc170.AGE_CODE
inner join (
  select AGE_CODE, sum(TARGET_POP) as pop from SLEEP_TIME_DTL
  where TIME_CODE = 180
  group by AGE_CODE
) as tc180
on tc120.AGE_CODE = tc180.AGE_CODE
inner join AGE_GRP
on tc120.AGE_CODE = AGE_GRP.AGE_CODE
order by tc120.AGE_CODE asc
;
提出情報
提出日時2022/07/17 14:26:25
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者tenten-tonton-tantan
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量80 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
80 MB
データパターン2
AC
78 MB