SQL 语法.内连接后更新 [英] SQL syntax. Update after inner join

查看:53
本文介绍了SQL 语法.内连接后更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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;

有人能告诉我这个语法有什么问题吗?我有2张桌子.nullemail 和 run1.当 nullemail 中的电子邮件 ID 与 run1 相同时,我想更新 nullemail 的列(fb_idname).

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.

推荐答案

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

试试这个

这篇关于SQL 语法.内连接后更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆