现在有两个表,tab1,tab2,通过各自的id1和id2关联起来,现在我想通过id1和id2的对应关系,把tab1中某几个字段的值赋给tab2种的某几个字 --tryinsert into table2(...) select .. from table1 inner join table2 on table1.id1=table2.id2 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 现在table2已经存在,不是insert into 的问题,我想update请问如何实现? update aset a.col1=b.col1from table2 a,table1 bwhere a.id2=b.id1 --tryupdate table1 set 字段=b.字段 from table1 a inner join table2 b on a.id1=b.id2 and ....条件.... update tab1 set field1=t.field1,field1=t.field2,field3=t.field3,....fieldn=t.fieldnfrom tab2 twhere tab1.id1=t.id1 and tab1.id2=t.id2 求一简单问题 大家帮帮忙,sql server 2005不能启动了 sql server 如何在两表之间建立级联删除 请问,在sql server 2000中如何使用timestamp 如何编写查询一行中2列值相等的所有项? 求sql语句在线等,急!!! 关于数据库系统表的问题 为什么sqlserver中不能在删除表的字段的时候不必考虑它的constraint? vs2012连接数据库时报错 请教一个简单的sqlserver 存储过程 如何判断一个表是否存在? 谢谢 效率问题
set a.col1=b.col1
from table2 a,table1 b
where a.id2=b.id1
update table1 set 字段=b.字段
from table1 a inner join table2 b on a.id1=b.id2 and ....条件....
set field1=t.field1,field1=t.field2,field3=t.field3,....fieldn=t.fieldn
from tab2 t
where tab1.id1=t.id1 and tab1.id2=t.id2