中指定TABLE_NAME我有一個SQL錯誤,我不能解決。我必須用一些連接來更新表格。我試過沒有「in」條款,但沒有成功。運行時,它加入SQL更新 - 不能在第
UPDATE sc_module_architect
SET
item_name="Print Cover Price"
WHERE
item_id IN (
SELECT a.item_id
FROM sc_module_architect a
LEFT JOIN sc_module_architect_category_links l on l.item_id=a.item_id
LEFT JOIN sc_module_architect_category c on c.category_content_id=l.content_id
LEFT JOIN sc_content sc on sc.content_id=l.content_id
WHERE item_active=1
AND content_name LIKE "ed_abc_print%"
LIKE item_name LIKE "Cover Price%");
現在我得到的錯誤
/* SQL Error (1093): You can't specify target table 'sc_module_architect' for update in FROM clause */
想不通,爲什麼這個來了:現在與條款,這裏的查詢我有。有任何想法嗎? MySQL的5.5
我想你可以加入。 Update-Where有限制。 – 2012-04-07 08:52:46