+ -
当前位置:首页 → 问答吧 → update修改的问题

update修改的问题

时间:2011-12-04

来源:互联网

请教下各位

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

作者: dh831108   发布时间: 2011-12-04

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

作者: qianjin036a   发布时间: 2011-12-04

SQL code
update a
set a.c=b.f
from b
where a.a=b.d and a.b=b.e

作者: roy_88   发布时间: 2011-12-04

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 = t2.fid and t2.fitemid=t3.fitemid and t1.fentryid_src=t3.fentryid and t2.fcheckerid = 0 ) b 
on mm.fentryid = b.fentryid and mm.fitemid = b.fitemid


帮我年看一下这断代码哪里错了。

我执行时提示这个错误:
消息 512,级别 16,状态 1,过程 bb,第 5 行
子查询返回的值不止一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。

作者: dh831108   发布时间: 2011-12-04

SQL code
update a set c=b.f from a,b where a.a=b.d and a.b=b.e

作者: fredrickhu   发布时间: 2011-12-04

热门下载

更多