missing expression and then group function not allowed error [message #496009] |
Wed, 23 February 2011 12:41 |
|
luron234
Messages: 2 Registered: February 2011
|
Junior Member |
|
|
Hello, I am wondering what I am doing wrong. I have 2 tables used in this problem: ODETAILS and ORDERS.
ODETAILS has the following columns: ONO, PNO, QTY, COST
ORDERS has the following columns: ONO, CNO, ENO, RECEIVED, SHIPPED, ORDER_COST
UPDATE ORDERS
SET ORDER_COST= 1 * ( select SUM(
SELECT COST
FROM ODETAILS
WHERE ORDERS.PNO=ODETAILS.PNO
)
);
In ODETAILS there can be more than 1 row for 1 order. So I'm trying to add all the COSTs in ODETAILS.
|
|
|
|
|
|