订单建议-判断物料是否存在备选物料+库存显示(汇总库存)
小于 1 分钟
- 示例代码
SELECT T0.[OrigItem], T0.[AltItem], T0.[Match], Ts.[qty] AS'备选物料总库存' FROM OALI T0
LEFT JOIN
(
SELECT T0.[ItemCode], SUM(T0.[OnHand]) AS'qty' FROM OITW T0
GROUP BY T0.[ItemCode]
) Ts ON TS.[ItemCode]=T0.[AltItem]
WHERE T0.[OrigItem]=$[ORCM.ITEMCODE]