#1064 - 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

Viewed 31

when i run this below query , i get error. what mistake i am doing in it?

`

UPDATE
  psu6_orders
SET
  psu6_orders.id_customer = psu6_orders2.id_customer
FROM
  psu6_orders,
  psu6_orders2
WHERE
  psu6_orders.id_order = psu6_orders2.id_order;
`

i get this error message

#1064 - 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

psu6_orders, psu6_orders2 WHERE psu6_orders.id_order = psu6_or...' at line 5'

1 Answers
 UPDATE psu6_orders, psu6_orders2 
   SET psu6_orders.id_customer = psu6_orders2.id_customer
   WHERE psu6_orders.id_order = psu6_orders2.id_order;

Here is the help page that has this exact code as an example https://mariadb.com/kb/en/update/

Related