UPDATE parts
SET stock = (SELECT parts.stock - [item selection].quantity AS Expr1)
FROM parts
CROSS JOIN [item selection]
WHERE ( parts.part_type = @QuantityParameter )
我想要的是我想要的东西我做了一个新订单减去客户购买的数量上的数量
答案 0 :(得分:0)
第一眼看到我在查询中看到代码格式问题,试试这个:
UPDATE parts
SET stock = parts.stock - [item selection].quantity
From parts
CROSS JOIN [item selection]
WHERE ( parts.part_type = @QuantityParameter )