您可以为所有不带的产品动态地执行此 *** 作
IF,只需添加所需的条件即可:
INSERT INTO tblBranchProducts (ProductID, ProductName, ProductCode, Quantity, Location) SELECt b.ProductID, a.ProductName, a.ProductCode, b.Quantity, b.DestinationLocationFROM tblStockMoves binner join tblWarehouseProducts a on b.ProductID = a.ProductIDLEFT JOIN tblBranchProducts c ON(a.productid = b.productid)where c.productid is null
和:
update tblBranchProducts aINNER join tblStockMoves b on a.productid = b.productidset a.quantity= b.qty
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)