I am wondering what I am doing wrong. I have 2 tables used in this problem: ODETAILS and PARTS.
ODETAILS has the following columns: ONO, PNO, QTY, COST
PARTS has the following columns: PNO, PNAME, QOH, PRICE, OLEVEL
I am trying to update the column COST in ODETAILS so that the COST = QTY * PRICE
PRICE is found in PARTS. But how can I connect those two tables. I am having a brain fart because this is what I tried:
UPDATE ODETAILS
SET COST = QTY *
(SELECT PRICE
FROM PARTS
WHERE PNO =
(SELECT PNO
FROM ODETAILS
WHERE NOT PNO= NULL
)
)
WHERE NOT PNO = NULL;