我想更新列URL的所有行測試,但我得到以下錯誤,從下面的查詢有什麼不對的SQL代碼
#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 STx AS a LEFT JOIN Routes AS b ON a.RouteID = b.RouteID WHERE a.GroupID ' at line 3
UPDATE Routes SET URL = 'test'
WHERE ID in (
SELECT b.ID
FROM Stx a left JOIN Routes b on a.RouteID = b.RouteID
where a.GroupID = 39 and a.Status = 'Provisioned'
);
爲什麼在這裏使用子查詢? – bernie 2013-02-08 20:15:27
要找到導致錯誤的問題,請先運行子查詢。如果它運行,然後從id(in subquery)中的路徑運行select id。如果運行成功,則問題在於更新行。 – 2013-02-08 20:32:49