what is the real cause of mysql error 1442?

老子叫甜甜 提交于 2019-11-27 09:44:23
BradLaney

You cannot refer to a table when updating it.

/* my sql does not support this */
UPDATE tableName WHERE 1 = (SELECT 1 FROM tableName)

From MySQL Docs:

A trigger can access both old and new data in its own table. A trigger can also affect other tables, but it is not permitted to modify a table that is already being used (for reading or writing) by the statement that invoked the function or trigger. (Before MySQL 5.0.10, a trigger cannot modify other tables.)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!