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

mod rewrite - Doing external redirect. .htaccess NS flag not working. How to achieve similar results? -

mysql - How to insert just year and month into date field? -