mysql中You can't specify target table <tbl> 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 )
也就是说将select出的结果再通过中间表select一遍,这样就规避了错误。注意,这个问题只出现于mysql,mssql和oracle不会出现此问题。
相关推荐
### MySQL中“You can’t specify target table for update in FROM clause”错误解决方法 在MySQL数据库管理过程中,遇到SQL语法错误是家常便饭,其中一种较为常见的错误是“You can’t specify target table for ...
在MySQL数据库中,错误代码1093 - "You can’t specify target table ‘t’ for update in FROM clause" 是一个常见的错误,它通常发生在尝试在一个`UPDATE`语句的`FROM`子句中直接引用要更新的目标表时。...
在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`...
...
错误消息"You can't specify target table 'wms_cabinet_form' for update in FROM clause"清楚地指出,在同一个UPDATE语句中,你不能先从`wms_cabinet_form`表中选择一些值,然后立即更新这个表。 在原始的UPDATE...
If you want to specify<br>your own output file name use the output redirection:<br><br> jad -p example1.class > myexm1.java<br><br>Option -d allows you to specify another directory for output files,...
I can't say much more about it except for the fact that its fast and compact<END><br>51,chexer.zip<br>As Jonathan wrote, "This is a tool I wrote to use in DevStudio to facilitate memory address ...
email1mapi.zip<br>Visual Basic code for Sending email using MAPI control.<END><br>48 , Dan.zip<br>Dan's All purpose masterful program <END><br>49 , metasite.zip<br>this vb code executes a request from...
It can post messages and recieve messages through the internet.<END><br>8 , optiondemo.zip<br>This example demonstrates how to create realistic Option Buttons in Visual Basic.<END><br>9 , mencrypt.zip...
(2KB)<END><br>28,listfind.zip<br>This sample shows how to use the CList<> template. (9KB)<END><br>29,ndbrow.zip<br>This Visual C++ 6 project shows how to create an MDI application that hosts ...
(you can divide you form in as many sizable sections as you want...).<END><br>13 , Label3D.zip<br>This is a Label 3D user control that works like the standard VB label control, but you can define the...
<br>}<br></script><br></head><br><body><br><form id="form1" runat="server"><br><asp:ScriptManager ID="ScriptManager1" runat="server"><br><Services><br><asp:ServiceReference Path="~/WebServices/...
<br><br>Stop A Directory Index From Being Shown 停示显示目录列表<br><br>Sometimes, for one reason or another, you will have no index file in your directory. This will, of course, mean that if someone ...
You can also create your own policy files that define arbitrary permission sets.<br/><br/>Comparison of the sample security policy file <br/><br/> <br/>Permissions/Resource Setting Admin Default ...
Can specify different icons for different operating systems.// 可以为不同的操作系统指定不同的图标。Optional. --> <icon> <image16x16>icons/icon16.png</image16x16> <image32x32>icons/icon32.png</image...
- `<ESC>BJD`: Downloads bitmap data for TrueType fonts. - `<ESC>BJF`: Formats cards. - `<ESC>BJS`: Prints memory card status. - `<ESC>BJT`: Recalls TrueType fonts. - `<ESC>BK`: Generates PDF417 ...