sql - Missing expression and then group function not allowed error -


i wondering doing wrong. have 2 tables
odetails , orders

odetails has following columns: ono, pno, qty, cost
orders has following columns: ono, cno, eno, received, shipped, order_cost

update orders set order_cost= 1 *  sum(     select cost     odetails     orders.pno=odetails.pno     ) ; 

try this. (sum in wrong place)

update orders set order_cost= 1 *  (     select sum(cost)     odetails     orders.pno=odetails.pno     ) ; 

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) -