Home > database >  SQl,UPDATE INNER JOIN You have an error in your SQL syntax
SQl,UPDATE INNER JOIN You have an error in your SQL syntax

Time:02-21

UPDATE A set A.amount = A.amount 
FROM product_in_stock AS A 
INNER JOIN move_str_start AS B ON A.id_model = B.id_model 
WHERE B.id_move=121 AND A.id_stock=7;

I have error:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM product_in_stock AS A INNER JOIN move_str_start AS B ON A.id_model = B.id_m' at line 1

CodePudding user response:

update product_in_stock AS A 
INNER JOIN move_str_start AS B ON A.id_model = B.id_model 
SET A.amount=A.amount B.count  
WHERE B.id_move=121 AND A.id_stock=7;

PS This is Answer

  • Related