oracle - SQL Script. Updating a column in a table -
i wondering doing wrong. have 2 tables used in problem: odetails , parts.
odetails has following columns: ono, pno, qty, cost
parts has following columns: pno, pname, qoh, price, olevel
trying update column cost in odetails cost = qty * price
price found in parts. how can connect 2 tables. having brain fart because tried:
update odetails set cost = qty * (select price parts pno = (select pno odetails not pno= null ) ) not pno = null;
i think second subquery wrong becasue can give multiple rows , unnecesary:
update odetails set cost = qty * (select price parts parts.pno = odetails.pno) pno not null
Comments
Post a Comment