千家信息网

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

发表于:2025-01-20 作者:千家信息网编辑
千家信息网最后更新 2025年01月20日,UPDATE Bins b SET b.ShopSn ='111201611111168706' WHERE b.Id IN (SELECT b.Id FROM Bins b JOIN BinInve
千家信息网最后更新 2025年01月20日Table is specified twice, both as a target for 'UPDATE' and as a separate source

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也存在这种情况

0