日期:2014-05-17 浏览次数:20432 次
SELECT InvCode AS 存货编码 ,
OpSeq AS 工序行号 ,
OpCode AS 工序代号 ,
opDescription AS 工序说明 ,
[杂质] = MAX(CASE WHEN ScrapReasonName = '杂质' THEN ScrapQty
ELSE 0
END) ,
[冲坏] = MAX(CASE WHEN ScrapReasonName = '冲坏' THEN ScrapQty
ELSE 0
END) ,
[模具脏] = MAX(CASE WHEN ScrapReasonName = '模具脏' THEN ScrapQty
ELSE 0
END)
FROM v_fc_moroutingbilllist
GROUP BY InvCode ,
OpSeq ,
OpCode ,
opDescription