首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

求oracle 多表update方法解决方法

2012-01-13 
求oracle 多表update方法t1-----------------------idABCt2---------------------idF如果满足条件:t1.idt

求oracle 多表update方法
t1
-----------------------
id         A             B             C

t2
---------------------
id         F

如果满足条件:t1.id   =   t2.id   ,     t1.B   =   '0 ',   F   =   null
就把F的值设置为C
请问如何实现   ?



[解决办法]
update t2 set t2.XX= 'F ' from t1,f2 where t1.id = t2.id and t1.B = '0 ' and F = null

[解决办法]
我来帮顶来了!!!!!
[解决办法]
update t2 set t2.F= 'C ' from t1,f2 where t1.id = t2.id and t1.B = '0 ' and F IS null 才行; Null是不能用‘=’的
[解决办法]
update t2 set t2.F=(select t1.C from t1 where t1.id = t2.id and t1.B = '0 ' and t2.F IS null )
[解决办法]
试试上面的sql应该可以的
[解决办法]
没反应?

[解决办法]
~~路过~帮顶~~
[解决办法]
ding
[解决办法]
~~路过~帮顶~~

[解决办法]
update t2 b
set b.f =
(select a.c from t1 a
where a.id = b.id and b.b <> 0 and a.f is null
)

热点排行