update publisher_info
set u_code = u_code
where publisher_info.id = unique_code.id;
最佳答案
您缺少第二个表unique_code
:
update publisher_info
set u_code = (SELECT u_code FROM unique_code
where publisher_info.id = unique_code.id);
或者加入:
update publisher_info
JOIN unique_code
ON publisher_info.id = unique_code.id
set publisher_info.u_code = unique_code.u_code
关于mysql - #1064 - 您的 SQL 语法有错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40886788/