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

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -