如何根据其他表的情况来update表? 比如我想更新g3表,在g32006表的总额字段>100000时 让g3表的test=4,怎么写?这2个表都有w1(工号)字段,g3表的记录比g32006的记录要多。但我只需要更新g32006表中有的数据 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 tryUpdate A Set test=4From g3 A Inner Join g32006 BOn A.w1 = B.w1Where B.总额>100000 或者Update A Set test=4From g3 A , g32006 BWhere A.w1 = B.w1And B.总额>100000 update g3set test=4from g3,g32006where g3.w1=g32006.w1and g32006.总额>100000 update b set test=4 from g32006 a,g3 b where a.w1=b.w1 and qa.总额字段>100000 update g3set g3.test=4from g3,g32006where g3.w1=g32006.w1 and g3.总额>100000 create trigger on g32006 for INSERT, UPDATEASif (select sum(总额) from g32006 ) >100000update g3 set test=4 Update aSet a.test=4From g3 a , g32006 bWhere a.w1 = b.w1And b.总额>100000 打多了个字update b set test=4 from g32006 a,g3 b where a.w1=b.w1 and a.总额字段>100000 是g32006.总额>100000楼上都这么答案了!! update g3 set test=4 from g3,g32006 where g3.w1=g32006.w1 and g32006.总额>100000 sql server 2008 R2 附加数据库失败 求解决办法,统计的问题 sql2005安装失败,大虾们给点实用的解决方案。 sql2005备份的数据库还原到2000上 求救! 查询两张表,group by必须要有吗 请教高手解释下MYSQL中LIMIT和OFFSET的用法 很弱的问题,请大家帮忙! 有一个难题:如何实现"不管哪个字段,只要包含要查询的字符就满足条件"的查询" 请提供一个oracle触发器示例 插入sql语句 高分在线急求一sql语句优化
Update A
Set test=4
From g3 A Inner Join g32006 B
On A.w1 = B.w1
Where B.总额>100000
Set test=4
From g3 A , g32006 B
Where A.w1 = B.w1
And B.总额>100000
set test=4
from g3,g32006
where g3.w1=g32006.w1
and g32006.总额>100000
set g3.test=4
from g3,g32006
where g3.w1=g32006.w1 and g3.总额>100000
AS
if (select sum(总额) from g32006 ) >100000
update g3 set test=4
Set a.test=4
From g3 a , g32006 b
Where a.w1 = b.w1
And b.总额>100000
from g32006 a,g3 b
where a.w1=b.w1 and a.总额字段>100000
update g3 set test=4 from g3,g32006 where g3.w1=g32006.w1 and g32006.总额>100000