Search code examples
mysqlupdate-inner-join

UPDATE with INNER JOIN phpmyadmin


UPDATE icmsc100 SET codigo='test'
FROM icmsc100
INNER JOIN icms307
ON icms307.ajusteDeCodigo = icmsc100.codigoItem;

I'm trying to use it this way, but it's returning an error, how should it be done?

Error #1064 - Syntax Error


Solution

  • You can update the data with the Inner Join In MYSQL as below.

    UPDATE icmsc100 
    INNER JOIN icms307 
    ON icms307.ajusteDeCodigo = icmsc100.codigoItem
    SET codigo='test';