コンテストの制限時間が終了しました。
以降も提出を行うことができますが、順位集計には反映されません。
以降も提出を行うことができますが、順位集計には反映されません。
ソースコード
WITH TMP AS (
SELECT
SURVEY_YEAR AS YEAR,
PF_CODE,
'小学校' AS KIND,
ELEMENTARY AS AMT,
1 AS ORD
FROM ENROLLMENT_STATUS
UNION
SELECT
SURVEY_YEAR AS AYEAR,
PF_CODE,
'中学校' AS KIND,
MIDDLE AS AMT,
2 AS ORD
FROM ENROLLMENT_STATUS
UNION
SELECT
SURVEY_YEAR AS YEAR,
PF_CODE,
'高校' AS KIND,
HIGH AS AMT,
3 AS ORD
FROM ENROLLMENT_STATUS
UNION
SELECT
SURVEY_YEAR AS YEAR,
PF_CODE,
'短大' AS KIND,
JUNIOR_CLG AS AMT,
4 AS ORD
FROM ENROLLMENT_STATUS
UNION
SELECT
SURVEY_YEAR AS YEAR,
PF_CODE,
'大学' AS KIND,
COLLEGE AS AMT,
5 AS ORD
FROM ENROLLMENT_STATUS
UNION
SELECT
SURVEY_YEAR AS YEAR,
PF_CODE,
'大学院' AS KIND,
GRADUATE AS AMT,
6 AS ORD
FROM ENROLLMENT_STATUS
)
SELECT
TMP.YEAR AS SV_YEAR,
P.PF_NAME AS PREFECTURE,
TMP.KIND AS KIND,
SUM(TMP.AMT) AS AMT
FROM TMP
JOIN PREFECTURE P
ON P.PF_CODE = TMP.PF_CODE
WHERE SV_YEAR = 2020 AND AMT IS NOT NULL
GROUP BY PREFECTURE, KIND
ORDER BY P.PF_CODE, TMP.ORD
提出情報
提出日時 | 2022/09/22 20:26:16 |
コンテスト | 第2回 SQLコンテスト |
問題 | 就学状況の表示変換 |
受験者 | drillmachine |
状態 (詳細) | WA (Wrong Answer: 誤答) |
メモリ使用量 | 78 MB |
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
78 MB
データパターン2
WA
76 MB