ソースコード
with master as (select age_name
, case time_code
when 120 then 1 end as time120
, case time_code
when 130 then 1 end as time130
, case time_code
when 140 then 1 end as time140
, case time_code
when 150 then 1 end as time150
, case time_code
when 160 then 1 end as time160
, case time_code
when 170 then 1 end as time170
, case time_code
when 180 then 1 end as time180
from(
select a.age_name as age_name, s.time_code as time_code, s.time_name as time_name
from sleep_time_dtl as sd
left join sleep_time as s
using(time_code)
left join age_grp as a
using(age_code)
))

select age_name as 年齢階層
, sum(time120) as '5時間未満'
, sum(time130) as '5時間以上6時間未満'
, sum(time140) as '6時間以上7時間未満'
, sum(time150) as '7時間以上8時間未満'
, sum(time160) as '8時間以上9時間未満'
, sum(time170) as '9時間以上'
, sum(time180) as 不詳
from master
group by age_name
order by 1
提出情報
提出日時2022/07/08 06:18:47
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者kazkida
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量77 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
77 MB
データパターン2
WA
76 MB