ソースコード
UPDATE scores
SET ranking = sub.rank
FROM (SELECT student_code,RANK() OVER(ORDER BY score DESC) AS rank FROM scores WHERE subject_code = "S00001") AS sub
WHERE scores.student_code=sub.student_code
AND subject_code = "S00001";

UPDATE scores
SET ranking = sub.rank
FROM (SELECT student_code,RANK() OVER(ORDER BY score DESC) AS rank FROM scores WHERE subject_code = "S00002") AS sub
WHERE scores.student_code=sub.student_code
AND subject_code = "S00002";

UPDATE scores
SET ranking = sub.rank
FROM (SELECT student_code,RANK() OVER(ORDER BY score DESC) AS rank FROM scores WHERE subject_code = "S00003") AS sub
WHERE scores.student_code=sub.student_code
AND subject_code = "S00003";
提出情報
提出日時2024/06/26 16:35:11
コンテストSQLの教科書確認用コンテスト4
問題分析関数の結果で更新2
受験者shakemayo
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量109 MB
メッセージ
テストケース(通過数/総数)
1/3
状態
メモリ使用量
データパターン1
AC
97 MB
データパターン2
WA
105 MB
データパターン3
WA
109 MB