Pokud používáte SQL Server, máte chybný JOIN
. A velmi špatné tabulkové aliasy. Možná to dělá to, co chcete:
update fs
set user_id = u.id,
message = SUBSTRING(fs.message, 1, CHARINDEX('[', fs.message)-1)
from edi_file_steps fs INNER JOIN
GU_User u
on u.login = SUBSTRING(fs.message, CHARINDEX('[', fs.message)+1, len(fs.message)- CHARINDEX('[',fs.message)-1 )
where message LIKE '%Downloaded%' ;
EDIT:
V MySQL by to bylo:
update edi_file_steps fs INNER JOIN
GU_User u
on fs.message like concat('%[', u.login, ']%')
set user_id = table_B.id,
message = substring_index(fs.message, '[', 1)
where message LIKE '%Downloaded%' ;