今天遇到一个需要批量修改数据库表中一个字段的数据,数据来源从另一张表的字段中获取,

SQL好不容易找到,记录一下
update t set t.name = (select t1.name from t1 where t1.no = t.no) ;

update多字段

update t set (t.name,t.sex) = (select t1.name.t1.sex from t1 where t1.no = t.no) ;

更多推荐

批量修改update SQL语句