SQL syntax. Update after inner join

家住魔仙堡 提交于 2019-12-12 02:34:40

问题


UPDATE 
     t1 
SET 
     t1.name=t2.name, t1.fb_id=t2.fb_id
FROM 
     nullemail t1
     INNER JOIN run1 t2
         ON t1.email=t2.email;

Can someone please tell me what is wrong with this syntax? I have 2 tables. nullemail and run1. I want to update nullemail's columns(fb_id and name) when the email id in nullemail is the same as run1.


回答1:


UPDATE nullemail t1, run1 t2  SET t1.name=t2.name, t1.fb_id=t2.fb_id
where t1.email=t2.email;

Try this



来源:https://stackoverflow.com/questions/17802921/sql-syntax-update-after-inner-join

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!