读书人

update修改的有关问题

发布时间: 2012-02-20 21:18:23 作者: rapoo

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……

读书人网 >SQL Server

热点推荐