#1064 - 您的SQL语法有错误

时间:2016-11-30 11:07:53

标签: mysql sql

update publisher_info
set u_code = u_code
where publisher_info.id = unique_code.id;

1 个答案:

答案 0 :(得分:0)

您缺少第二个表格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