mysql syntax error with inner join on two tables

Aymen Ragoubi :

I have this sql query:

update edi_file_steps 
set 
    table_A.user_id= table_B.id ,
    table_A.message= SUBSTRING_INDEX(table_A.message,'[',1)
FROM 
    edi_file.steps AS table_A INNER JOIN GU_User as table_B
where 
   message LIKE '%Downloaded%'AND table_B.login = 'Jack'

But I am getting mysql syntax error. Is there a problem with my syntax? I am using mysql 5.7.

Tum :

You can't use FROM in an UPDATE query, you specify the table after the UPDATE statement:

UPDATE edi_file_steps table_A
INNER JOIN GU_User AS table_B
SET 
    table_A.user_id= table_B.id ,
    table_A.message= SUBSTRING_INDEX(table_A.message,'[',1)
WHERE 
    message LIKE '%Downloaded%'AND table_B.login = 'Jack'

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=394773&siteId=1