2016-11-30 93 views
0
update publisher_info 
set u_code = u_code 
where publisher_info.id = unique_code.id; 
+0

什么是完整的错误? –

+0

该错误消息与给定的查询无关。在给定查询中没有“from unique_code”! – Sirko

+0

我想在phpmyadmin中,我的第一个表名是publisher_info,第二个表名是unique_code。我想将u_code colourmn数据从unique_code表传递给publisher_info表。我是新的sql所以plz帮我 –

回答

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 
+0

它的工作!感谢ü这么多的解决方案。 –

+0

如何在我的php代码中实现这个? –

+0

对不起,这不是我的专业知识:) – sagi

相关问题