mercredi 13 juillet 2016

SQL Server Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >=

Once I run this query, I get the following error.

 select 
 OrderDetails.Sku,orderdetails.mf_item_number,orderdetails.Qty,orderdetails.Price,Supplier.SupplierId,
 Supplier.SupplierName,Supplier.DropShipFees,
 cost = (Select  Supplier_Item.Price
 from
 Supplier_Item,orderdetails,Supplier
 where
 Supplier_Item.SKU=OrderDetails.Sku and
 Supplier_Item.SupplierId=Supplier.SupplierID
 )     from
 orderdetails,Supplier,Group_Master
 where invoiceid='339740' and
 OrderDetails.Mfr_ID =
 Supplier.SupplierId  and
 Group_Master.Sku = OrderDetails.Sku

Msg 512, Level 16, State 1, Line 2 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

Any ideas?

Aucun commentaire:

Enregistrer un commentaire