- SQL code
select sum(部品个数) from composing where 产品编号 in(select distinct 产品编号 from destine where 交货日期>'2012-06-30' and 交货日期<='2012-09-01' and 部品品番='LX5478-0101A')--此处有右括号,反回结果正常,法语应该报错的,但是没有.select sum(部品个数) from composing where 产品编号 in(select distinct 产品编号 from destine where 交货日期>'2012-06-30' and 交货日期<='2012-09-01') --右括号在此,语法才是正确的. and 部品品番='LX5478-0101A'--问题,destine表中是没有"部品品番"这个字段的.
------解决方案--------------------
部品品番--在括号里,两个表中有一个存在此字段都成立,优先字查询
在括号外,只能是composing表存在这字段才成立
------解决方案--------------------