我需要使用連接和限制來更新表。我構建此查詢Mysql更新通過加入並限制
UPDATE table1
JOIN table2 AS b
ON table1.id = b.id
SET
table1.username = b.post_username
WHERE b.post_username != ''
AND table1.username = ''
LIMIT 10
unfortunaetly我recive錯誤:
Error Code: 1221
Incorrect usage of UPDATE and LIMIT
我該如何解決這個問題?
你不能用限制這樣的更新 –