关联子查询Update语句更新数据

2015-03-07 0 577
关联子查询Update语句更新数据
--方法1:
Update Table1 set c = (select c from Table2 where a = Table1.a) where c is null 

--方法2:
update  A
set  newqiantity=B.qiantity
from  A,B
where  A.bnum=B.bnum 

--方法3:
update
    (select A.bnum ,A.newqiantity,B.qiantity from A left join B on A.bnum=B.bnum) AS C
set C.newqiantity = C.qiantity
where C.bnum =XX 

遇见资源网 sql 关联子查询Update语句更新数据 http://www.ox520.com/17549.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务