我运行以下查询:
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,16层,1号州2号线 子查询返回多于1个值。当子查询跟随 = ,! 时,这是不允许的!= ,< ,< = ,> ,> = 或当子查询用作表达式时。
有什么想法吗?