mysql中You can't specify target table for update in FROM clause錯誤的意思是說,不能先select出同一表中的某些值,再update這個表(在同一語句中)。 例如下面這個sql:
復制代碼 代碼如下:
delete from tbl where id in ( select max(id) from tbl a where EXISTS ( select 1 from tbl b where a.tac=b.tac group by tac HAVING count(1)>1 ) group by tac )
改寫成下面就行了:
復制代碼 代碼如下:
delete from tbl where id in ( select a.id from ( select max(id) id from tbl a where EXISTS ( select 1 from tbl b where a.tac=b.tac group by tac HAVING count(1)>1 ) group by tac ) a )
mysql中錯誤:1093-You can’t specify target table for update in FROM clause的解決方法mysql “ Every derived table must have its own alias”出現(xiàn)錯誤解決辦法讀取mysql一個庫下面的所有的表tableMySQL無法重啟報錯Warning: World-writable config file ‘/etc/my.cnf’ is ignored的解決方法mysql Event Scheduler: Failed to open table mysql.event出現(xiàn)錯誤mysql Table ''performance_schema...解決辦法