日期:2014-05-17 浏览次数:20785 次
SELECT a.scph 生产批次1, a.Pcode 产品型号3, a.Xpcode 芯片3, a.Zjcode 支架3, a.WavelengthGrade 芯片波段1, a.produceqty, a.存量, a.Seq AS 配胶方案序号1, CASE a.State WHEN 1 THEN '待首件方案' WHEN 2 THEN '待配首件' WHEN 3 THEN '待首件检验' WHEN 4 THEN '待自主方案' WHEN 5 THEN '待配自主' WHEN 6 THEN '待自主检验' WHEN 7 THEN '待配批量' WHEN 8 THEN '批量结束' WHEN 9 THEN '待首件方案' END 方案状态 FROM ( SELECT a.id, a.scph, b.Pcode, b.Xpcode, b.Zjcode, a.WavelengthGrade, a.Seq, a.State, c.produceqty, c.存量 FROM dbo.Jit_Mucus_RateScheme a INNER JOIN jit_rwd b ON a.scph = b.scph INNER JOIN ( SELECT c.scph, d.scph,------是不是这里有问题,字段名相同了,加了别名试试 c.produceQty, c.produceQty -d.produceQty AS 存量 FROM ( ( SELECT scph, produceqty FROM dbo.View_Jit_rwdProduceProcess WHERE StepName = '焊芯片/芯片+zener' ) c INNER JOIN ( SELECT scph, produceqty FROM dbo.View_Jit_rwdProduceProcess WHERE StepName = '注胶' ) d ON c.scph = d.scph ) ) c ON c.scph = a.Scph ) a