コンテストの制限時間が終了しました。
以降も提出を行うことができますが、順位集計には反映されません。
以降も提出を行うことができますが、順位集計には反映されません。
ソースコード
with t0 as
(
select
*
from AGE_GRP
)
, t1 as
(
select
*
from SLEEP_TIME
)
, t2 as
(
select
*
from sleep_time_dtl
)
, t3 as
(
select
age_name, t0.age_code, time_code,
target_pop
from t2
left join t0
on t2.age_code=t0.age_code
)
, t4 as
(
select
age_name, time_name, t3.time_code,
target_pop
from t3
left join t1
on t3.time_code=t1.time_code
)
, t5 as
(
select
age_name, time_name, time_code,
sum(target_pop) as count_
from t4
group by age_name, time_name, time_code
)
, t6 as
(
select
age_name,
count_,
case when time_code=120 then count_ else 0 end as col1 ,
case when time_code=130 then count_ else 0 end as col2,
case when time_code=140 then count_ else 0 end as col3,
case when time_code=150 then count_ else 0 end as col4,
case when time_code=160 then count_ else 0 end as col5,
case when time_code=170 then count_ else 0 end as col6,
case when time_code=180 then count_ else 0 end as col7
from t5
)
, t7 as
(
select
age_name as '年齢階層',
sum(col1) as '5時間未満',
sum(col2) as '5時間以上6時間未満',
sum(col3) as '6時間以上7時間未満',
sum(col4) as '7時間以上8時間未満',
sum(col5) as '8時間以上9時間未満',
sum(col6) as '9時間以上',
sum(col7) as '不詳'
from t6
group by age_name
)
select * from t7
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
102 MB
データパターン2
AC
101 MB