コンテストの制限時間が終了しました。
以降も提出を行うことができますが、順位集計には反映されません。
以降も提出を行うことができますが、順位集計には反映されません。
ソースコード
select
t1.AGE_NAME as 年齢階層
, a1.s as '5時間未満'
, a2.s as '5時間以上6時間未満'
, a3.s as '6時間以上7時間未満'
, a4.s as '7時間以上8時間未満'
, a5.s as '8時間以上9時間未満'
, a6.s as '9時間以上'
, a7.s as 不詳
from
AGE_GRP t1
-- 5時間未満
left join (select AGE_CODE,SUM(TARGET_POP) s from SLEEP_TIME_DTL where TIME_CODE = 120 GROUP BY AGE_CODE) a1
on t1.AGE_CODE = a1.AGE_CODE
-- 5時間以上6時間未満
inner join (select AGE_CODE,SUM(TARGET_POP) s from SLEEP_TIME_DTL where TIME_CODE = 130 GROUP BY AGE_CODE) a2
on t1.AGE_CODE = a2.AGE_CODE
-- 6時間以上7時間未満
inner join (select AGE_CODE,SUM(TARGET_POP) s from SLEEP_TIME_DTL where TIME_CODE = 140 GROUP BY AGE_CODE) a3
on t1.AGE_CODE = a3.AGE_CODE
-- 7時間以上8時間未満
inner join (select AGE_CODE,SUM(TARGET_POP) s from SLEEP_TIME_DTL where TIME_CODE = 150 GROUP BY AGE_CODE) a4
on t1.AGE_CODE = a4.AGE_CODE
-- 8時間以上9時間未満
inner join (select AGE_CODE,SUM(TARGET_POP) s from SLEEP_TIME_DTL where TIME_CODE = 160 GROUP BY AGE_CODE) a5
on t1.AGE_CODE = a5.AGE_CODE
-- 9時間以上
inner join (select AGE_CODE,SUM(TARGET_POP) s from SLEEP_TIME_DTL where TIME_CODE = 170 GROUP BY AGE_CODE) a6
on t1.AGE_CODE = a6.AGE_CODE
-- 不詳
inner join (select AGE_CODE,SUM(TARGET_POP) s from SLEEP_TIME_DTL where TIME_CODE = 180 GROUP BY AGE_CODE) a7
on t1.AGE_CODE = a7.AGE_CODE
order by
t1.AGE_CODE
;
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
81 MB
データパターン2
AC
81 MB