sql一对多查询
子查询返回的值不止一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。
正确写法:
select Material_Manage.MaterialNum,Material_Manage.MaterialName,Material_Manage.MaterialWeight,Material_Manage.Supplier,Material_Manage.ProductionDate,Material_Manage.StorageAmount from Material_Manage where MaterialName in (select Formula_Info.MaterialName from Formula_Info where FormulaName=@FormulaName