ソースコード
with RECURSIVE pf_list(Val) as(
select 1 as Val, *
from(
select e.SURVEY_YEAR as SV_YEAR, e.PF_CODE, p.PF_NAME as PREFECTURE,
COALESCE(SUM(e.ELEMENTARY), 0) as '小学校',COALESCE(SUM(e.MIDDLE), 0) as '中学校', 
COALESCE(SUM(e.HIGH), 0) as '高校',COALESCE(SUM(e.JUNIOR_CLG), 0) as '短大', 
COALESCE(SUM(e.COLLEGE), 0) as '大学',COALESCE(SUM(e.GRADUATE), 0) as '大学院'
from ENROLLMENT_STATUS as e
JOIN PREFECTURE as p ON e.PF_CODE = p.PF_CODE
GROUP BY e.SURVEY_YEAR,e.PF_CODE
HAVING e.SURVEY_YEAR = 2020
)
UNION ALL
select Val+1, *
  from pf_list
 where Val+1 <= 6
)

select * 
from PREFECTURE as p
cross join pf_list as pl
where p.PF_CODE = pl.PF_CODE
提出情報
提出日時2023/06/26 13:40:03
コンテスト第2回 SQLコンテスト
問題就学状況の表示変換
受験者kota3
状態 (詳細)RE
(Runtime Error: 実行時エラー)
メモリ使用量80 MB
メッセージ
SQLITE_ERROR: table pf_list has 10 values for 1 columns
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
RE
80 MB
データパターン2
RE
78 MB