《Mysql必讀mysql中You can’t specify target table for update in FROM clause錯誤解決方法》要點:
本文介紹了Mysql必讀mysql中You can’t specify target table for update in FROM clause錯誤解決方法,希望對您有用。如果有疑問,可以聯系我們。
mysql中You can't specify target table for update in FROM clause錯誤的意思是說,不能先select出同一表中的某些值,再update這個表(在同一語句中). 例如下面這個sql:
MYSQL數據庫
改寫成下面就行了:MYSQL數據庫
也便是說將select出的結果再通過中間表select一遍,這樣就規避了錯誤.注意,這個問題只出現于mysql,mssql和oracle不會出現此問題.MYSQL數據庫
《Mysql必讀mysql中You can’t specify target table for update in FROM clause錯誤解決方法》是否對您有啟發,歡迎查看更多與《Mysql必讀mysql中You can’t specify target table for update in FROM clause錯誤解決方法》相關教程,學精學透。維易PHP學院為您提供精彩教程。