我試圖在雙INNER JOIN
做一個UPDATE
,並得到以下錯誤:UPDATE和雙INNER JOIN踢了MySQL錯誤
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM pro_users AS u INNER JOIN cAlerts AS c ON c.user_id = u.user_id I' at line 3
這裏是我的MySQL代碼:
UPDATE u
SET u.active_member = 0
FROM pro_users AS u
INNER JOIN cAlerts AS c
ON c.user_id = u.user_id
INNER JOIN srAlerts AS s
ON s.user_id = c.user_id
WHERE c.status=0
AND s.active=0
AND u.active_member = 1
你能發現我的錯誤嗎?
使用UPDATE pro_users,我認爲它不知道的別名。 – Mihai
當我使用該語法時,我不使用set子句中的別名。 –
我嘗試使用「更新pro_users」,而不是「更新你」,並沒有奏效。 – themerlinproject