good morning. I come to ask for help. I can't see what is wrong with this statement.
UPDATE
P
SET
P.id_articulo = A.id_articulo
FROM
articulos_x_proveedor AS P
INNER JOIN articulos AS A
ON A.codigo_interno = P.cod_proveedor
WHERE
P.id_articulo = 0 AND P.papelera = 0
AND A.papelera = 0 AND A.id_agenda = 2395
When executing the query it returns me this:
Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM articles_x_proveedor AS P INNER JOIN articles AS A ON A.co' at line 5 (0 ms taken)
I would appreciate the help!
You could do what you want with a simple subquery directly assigned to the column: