真に等しい状態であれば、私は、乗算 (od.price * od.kiloを)好きで、その後、私は、乗算(* od.quant od.priceをしたいと思います他の分野、他 サブクエリーが2つ以上の値を返しました。声明
をもたらすならば、間違いました)、その後、あなたが何であるか、あなたの選択でこれらのIF..ELSE文、あるいはサブクエリのいずれかを必要としないPROC GET_ORDER_ACCOUNT_DETAILS @ORDERID INT
AS
BEGIN
IF((SELECT calcType FROM orderDetailsTBL od WHERE od.orderID = @ORDERID) = 'K')
BEGIN
SELECT
(SELECT od.price * od.kilo FROM orderDetailsTBL od) as "AMOUNT",
od.quant as "QUANTITY" ,
od.kilo as "KILO" ,
od.price as "PRICE" ,
od.calcType as "UNIT" ,
p.prodName as "NAME" ,
od.recivedID as "RECIVED"
FROM orderAccTBL oa
JOIN orderDetailsTBL od ON od.orderID = oa.orderID
JOIN productTBL p ON p.prodID = od.productID
WHERE
oa.orderID = @ORDERID
END
ELSE
BEGIN
SELECT
(SELECT od.quant * od.price FROM orderDetailsTBL od) as "AMOUNT",
od.quant as "QUANTITY" ,
od.kilo as "KILO" ,
od.price as "PRICE" ,
od.calcType as "UNIT" ,
p.prodName as "NAME" ,
od.recivedID as "RECIVED"
FROM orderAccTBL oa
JOIN orderDetailsTBL od ON od.orderID = oa.orderID
JOIN productTBL p ON p.prodID = od.productID
WHERE
oa.orderID = @ORDERID
END
END
あなたの問題点を説明し、特定の質問をする必要があります。 – bwoogie