Mysql执行删除语句
DELETE FROM agency WHERE id in(
SELECT b.id from agency b WHERE b.stateId in(
SELECT a.ID from states a WHERE a.saved=0 or a.saved=-1
)
)
出现You can't specify target table 'agency' for update in FROM clause错误,
解决方法:
DELETE FROM agency WHERE id in(
SELECT aaaa.id from(
SELECT b.id from agency b WHERE b.stateId in(
SELECT a.ID from states a WHERE a.saved=0 or a.saved=-1
)
) aaaa
)
也就是说将select出的结果再通过中间表select一遍
相关推荐
### MySQL中“You can’t specify target table for update in FROM clause”错误解决方法 在MySQL数据库管理过程中,遇到SQL语法错误是家常便饭,其中一种较为常见的错误是“You can’t specify target table for ...
在MySQL数据库中,"You can’t specify target table for update in FROM clause"是一个常见的错误提示,意味着在同一个SQL语句中,你不能直接在一个`UPDATE`或`DELETE`语句的`FROM`子句中引用你想要更新或删除的表...
在MySQL中,错误1093 - "You can't specify target table for update in FROM clause" 是一个常见的问题,它发生在尝试在`UPDATE`语句的`FROM`子句中直接引用要更新的同一张表时。这个错误表示MySQL不支持在`UPDATE`...
在MySQL数据库中,错误代码1093 - "You can’t specify target table ‘t’ for update in FROM clause" 是一个常见的错误,它通常发生在尝试在一个`UPDATE`语句的`FROM`子句中直接引用要更新的目标表时。...
...
错误消息"You can't specify target table 'wms_cabinet_form' for update in FROM clause"清楚地指出,在同一个UPDATE语句中,你不能先从`wms_cabinet_form`表中选择一些值,然后立即更新这个表。 在原始的UPDATE...
mysql 语句如下: update wms_cabinet_form set cabf_enabled=0 where cabf_id in ( SELECT wms_cabinet_form.cabf_id FROM wms_cabinet_form Inner Join wms_cabinet ON wms_cabinet_form.cabf_cab_id = wms_...
在平常的项目中,经常会碰到这样的问题:我需要在一张标中同时更新和查询出来的...结果却报错,报错信息为:You can't specify target table 'tb_test' for update in FROM clause,不能在同一语句中update,select同
(b) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have...
导致了`java.sql.SQLException: You can’t specify target table ‘chat_messages’ for update in FROM clause`的错误。为了解决这个问题,我们需要对查询部分进行修改,确保它不直接引用正在插入的表。 修正后的...
You can specify for how many concurrent threads these steps will be executed and which Oracle accounts should be used. The performance results can be viewed in real-time as text, bar chart, or line ...
5. 更新同一表数据的问题:`ERROR 1093 (HY000): You can't specify target table 'context' for update in FROM clause`表示不能在FROM子句中直接更新同一张表。 6. 主键自动增长问题:`ERROR 1062`可能是由于试图...
and which you don't want SQL Assistant to treat as keywords, for example, the default configuration includes ID and Name, names, you can add your own. "Show Keys and Indexed Columns" is preset for ...
You can also specify the /logmsg switch to pass a predefined log message to the commit dialog. Or, if you don't want to pass the log message on the command line, use /logmsgfile:path, where ...
If you don’t know the table owner or don’t want to enter it you can just enter a period. The idea of a custom autocomplete list is new. It gives you the ability to list anything you want. What ...
错误提示是 `ERROR 1093 (HY000): You can't specify target table 'apples' for update in FROM clause.` 这意味着MySQL不允许在 `UPDATE` 语句的 `FROM` 子句中直接引用要更新的表。 解决办法: 尽管MySQL不支持...
这会导致错误 `[Err] 1093 – You can't specify target table 'a' for update in FROM clause`。MySQL不允许在`SET`或`WHERE`子句中直接引用被更新的表进行子查询。这是因为在执行过程中,MySQL无法确定子查询的...
Download the 2013 v1 update to access the new TileControl to achieve a Windows 8 look and feel in your desktop apps as well as feature enhancements for Reports, Editor, and Scheduler. See the what's ...