简体   繁体   English

SQL语法。 内部联接后更新

[英]SQL syntax. Update after inner join

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. 我有2张桌子。 nullemail and run1. nullemail和run1。 I want to update nullemail's columns( fb_id and name ) when the email id in nullemail is the same as run1. 当nullemail中的电子邮件ID与run1相同时,我想更新nullemail的列( fb_idname )。

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

Try this 尝试这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM