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错误解决方法,需要的朋友可以参考下
1093 – You can’t specify target table ‘t’ for update in FROM clause, Time: 0 前情提示: Mac OS10.14+MySQL8.0.18; centOS6.8final+MySQL5.6; 解决: 方法一:多嵌套一层。多来一层子查询 以上SQL修改...
最近在工作中遇到了一个mysql错误提示1093:You can’t specify target table for update in FROM clause,后来通过查找相关的资料解决了这个问题,现在将解决的方法分享给大家,有需要的朋友们可以参考借鉴,下面来...
。。。
...
mysql 一个较特殊的问题:You can't specify target table 'wms_cabinet_form' for update in F
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 ...
in<br>addition to Anys and Typed-events as supported by the existing Event Service.<br>• The ability for clients to specify exactly which events they are interested in<br>receiving, by attaching ...
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 ...
If you can't figure out what this program does, you're probably brain-dead and need immediate medical attention. endef # Specify what needs to be done to prepare for building the package. # In our ...