update语句更新问题

weixinzhu 2004-09-09 09:20:54
在sql server 是这样写的:
update A
set A.a=B.c
from B
where A.d=B.d
请问在oracle里是怎么实现的?
...全文
142 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
bill_810 2004-10-13
  • 打赏
  • 举报
回复
能不能一次更新多列?
weixinzhu 2004-09-09
  • 打赏
  • 举报
回复
非常感谢大家的支持,谢谢
bzszp 2004-09-09
  • 打赏
  • 举报
回复
我个人不赞成使用nvl((select c from B where A.d=B.d),a);
这种写法,这样对对整个表进行update,而且多写大量日志
CodeMagic 2004-09-09
  • 打赏
  • 举报
回复
update A set a=nvl((select c from B where A.d=B.d),a);
shbjwq430105 2004-09-09
  • 打赏
  • 举报
回复
update a set a.a=
(select b.c from b where a.d=b.d)

update A set A.s = (select B.c from B where A.d=B.d) where exists(select 1 from B where a.d = b.d)
bzszp 2004-09-09
  • 打赏
  • 举报
回复
update a set a.a=(select max(b.c) from b where a.d=b.d)
where exists (select * from b where a.d=b.d);
wylwyl1130 2004-09-09
  • 打赏
  • 举报
回复
update A set A.s = (select B.c from B where A.d=B.d) where exists(select * from B where a.d = b.d)

17,086

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧