ソースコード
with k as(
    select time_code as t, age_code as a, sum(target_pop) as p
    from sleep_time_dtl
    group by time_code, age_code
)
select age_grp.age_name as "年齢階層",
    k_120.p as "5時間未満",
    k_130.p as "5時間以上6時間未満",
    k_140.p as "6時間以上7時間未満",
    k_150.p as "7時間以上8時間未満",
    k_160.p as "8時間以上9時間未満",
    k_170.p as "9時間以上",
    k_180.p as "不詳"
from age_grp
inner join k as k_120 on age_grp.age_code = k_120.a and k_120.t = 120
inner join k as k_130 on age_grp.age_code = k_130.a and k_130.t = 130
inner join k as k_140 on age_grp.age_code = k_140.a and k_140.t = 140
inner join k as k_150 on age_grp.age_code = k_150.a and k_150.t = 150
inner join k as k_160 on age_grp.age_code = k_160.a and k_160.t = 160
inner join k as k_170 on age_grp.age_code = k_170.a and k_170.t = 170
inner join k as k_180 on age_grp.age_code = k_180.a and k_180.t = 180
;
提出情報
提出日時2022/07/13 10:39:28
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者it_on_sundays
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量79 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
79 MB
データパターン2
AC
77 MB