码迷,mamicode.com
首页 > 其他好文 > 详细

Table is specified twice, both as a target for 'UPDATE' and as a separate source

时间:2019-06-12 21:24:10      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:get   set   ops   bin   ice   from   table   specified   ISE   

UPDATE Bins b SET b.ShopSn =’111201611111168706’ WHERE b.Id IN (SELECT b.Id FROM Bins b JOIN BinInventory bi ON bi.BinId = b.Id WHERE bi.Quantity >0 AND b.IsEnable=1 AND bi.IsEnable =1);

UPDATE Bins b SET b.ShopSn =’111201611111168706’ WHERE b.Id IN (select * from (SELECT b.Id FROM Bins b JOIN BinInventory bi ON bi.BinId = b.Id WHERE bi.Quantity >0 AND b.IsEnable=1 AND bi.IsEnable =1) as Y);

测试delete也存在这种情况

Table is specified twice, both as a target for 'UPDATE' and as a separate source

标签:get   set   ops   bin   ice   from   table   specified   ISE   

原文地址:https://www.cnblogs.com/hankyoon/p/11012606.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!