ソースコード
CREATE TEMPORARY TABLE TMP_POP as SELECT AGE_CODE, sum(SP_TIME_5) as "SP_TIME_5", sum(SP_TIME_6)  as "SP_TIME_6", sum(SP_TIME_7)  as "SP_TIME_7", sum(SP_TIME_8)  as "SP_TIME_8", sum(SP_TIME_9) as "SP_TIME_9", sum(SP_TIME_9OVER)  as "SP_TIME_9OVER" from SLEEP_TIME_DTL where PF_CODE in ('01000','02000','03000','04000','07000') group by AGE_CODE;

select TMP_POP.AGE_CODE as "年齢コード", AGE_NAME as "年齢階層名", SP_TIME_5 as "5時間未満", SP_TIME_6 as "5時間以上6時間未満", SP_TIME_7 as "6時間以上7時間未満",
SP_TIME_8 as "7時間以上8時間未満", SP_TIME_9 as "8時間以上9時間未満", SP_TIME_9OVER as "9時間以上" from TMP_POP inner join AGE_GRP on TMP_POP.AGE_CODE = AGE_GRP.AGE_CODE;
提出情報
提出日時2022/07/20 20:33:08
コンテスト第1回 SQLコンテスト
問題睡眠時間帯別集計
受験者otsuneko
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量85 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
85 MB
データパターン2
AC
84 MB