两个表有什么关联吗 或者说凭什么条件让b表中的字段3赋给a表中的字段1update a set a.字段1 = (select b.字段3 from b where b.字段4 = a.字段2) where exists (select b.字段3 from b where b.字段4 = a.字段2);
可以用这样的方式,不过这里的a,b表的对应关系需要一一对应或者是多对一的关系。用update a set a.col1=select b.col3 from b where a.id = b.id;
或者说凭什么条件让b表中的字段3赋给a表中的字段1update a set a.字段1 = (select b.字段3 from b where b.字段4 = a.字段2) where exists
(select b.字段3 from b where b.字段4 = a.字段2);
可以用这样的方式,不过这里的a,b表的对应关系需要一一对应或者是多对一的关系。用update a set a.col1=select b.col3 from b where a.id = b.id;