SELECT gg.itemid,gi.id,gi.courseid, gg.userid, gg.finalgrade
FROM pauls_grade_grades gg, pauls_grade_items gi
WHERE gg.itemid = gi.id AND gg.userid =36 AND gi.courseid = 13
上記と同じ選択クエリの更新クエリが必要です。
UPDATE pauls_grade_grades
SET pauls_grade_grades.finalgrade = 28
WHERE usermodified IS NULL AND userid = 36 AND
itemid IN (SELECT gi.id
FROM pauls_grade_items gi
WHERE gi.courseid=13)
これは UPDATE クエリを記述する正しい方法ですか?