当前位置: 代码迷 >> Sql Server >> update修改的有关问题
  详细解决方案

update修改的有关问题

热度:88   发布时间:2016-04-27 18:06:21.0
update修改的问题
请教下各位

A 表 B 表

a b c d e f
---------- ----------
1 2 3 1 2 5
2 3 4 2 3 7
3 a b 3 a m
. . . . . .  
. . . . . .  
. . . . . .  
. . . . . .  
. . . . . .  
. . . . . .  
. . . . . .  
. . . . . .  
. . . . . .  
. . . . . .  
. . . . . . 写一个update 语句,当a表的a.a=b.d and a.b=b.e时更改a.c=b.f

------解决方案--------------------
SQL code
update t1 set c=t2.f from a t1 inner join b t2 on t1.a=t2.d and t1.b=t2.e
------解决方案--------------------
SQL code
update aset a.c=b.ffrom bwhere a.a=b.d and a.b=b.e
------解决方案--------------------
SQL code
update a set c=b.f from a,b where a.a=b.d and a.b=b.e
------解决方案--------------------
探讨

update mm set mm.FEntrySelfS0168 = b.fbillno
from seorderentry mm inner join
(select t2.fbillno,t1.fentryid,t2.fitemid
from t_sz_wkorderentry t1,t_sz_wkorder t2 ,seorderentry t3
where t1.fid = t……
  相关解决方案