-1
我試圖更新具有父表的特定表中的列。 表是gradings
在這個表我要更新其值是sy_id.
MySQL更新INNER JOIN
其他表school_years
具有其中具有值列sy_id
和sy_dates
列。 2018 -2019, 2019 - 2020....
我想更新gradings
中的sy_id
列,但我不知道如何解決這個錯誤。
UPDATE gradings
INNER JOIN school_years
ON gradings.sy_id = school_years.sy_dates
INNER JOIN students
ON gradings.student_id = students.id
SET gradings.sy_id = '2017 - 2018'
WHERE students.id = 1;
有什麼想法?
到底是什麼錯誤? – MontyPython
WHERE students.id = 1;應該是'1'(引用)? – Berniev
@Berniev - 不,並不強制要保留1引用。 – MontyPython