如何将这条SQL的update语句改成Oracle的语句(同时修改多字段)?

mobbs 2003-10-28 06:10:58
如何将这条SQL的update语句改成Oracle的语句(同时修改多字段)?
update table1 set f1=b.f1,f2=b.f2,f3=b.f3 from table1 a,bable2 b where a.id=b.id
...全文
182 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
beckhambobo 2003-10-28
  • 打赏
  • 举报
回复
update table1 a set (f1,f2,f3)=(select f1,f2,f3 from bable2 b where a.id=b.id)
smallcrocodile 2003-10-28
  • 打赏
  • 举报
回复
支持楼上
vrv0129 2003-10-28
  • 打赏
  • 举报
回复
update table1
set
f1=(select b.f1 from bable2 b,table1 a where a.id=b.id),
f2=(select b.f2 from bable2 b,table1 a where a.id=b.id),
f3=(select b.f3 from bable2 b,table1 a where a.id=b.id);
hdkkk 2003-10-28
  • 打赏
  • 举报
回复
update table1 set (f1,f2,f3)=select f1,f2,f3 from bable2 b where a.id=b.id
where exist(select 1 from bable2 b,table1 a where a.id=b.id)
LGQDUCKY 2003-10-28
  • 打赏
  • 举报
回复
oracle要这样写
update table1
set f1=(select b.f1 from bable2 b,table1 a where a.id=b.id),
f2=(select b.f2 from bable2 b,table1 a where a.id=b.id),
f3=(select b.f3 from bable2 b,table1 a where a.id=b.id);
jiezhi 2003-10-28
  • 打赏
  • 举报
回复
update table1 set f1=b.f1,f2=b.f2,f3=b.f3
from table1 a,bable2 b where a.id=b.id
--------->>>>
update table1
set f1=(select b.f1 from bable2 b,table1 a where a.id=b.id),
f2=(select b.f2 from bable2 b,table1 a where a.id=b.id),
f3=(select b.f3 from bable2 b,table1 a where a.id=b.id)
where exist(select 1 from bable2 b,table1 a where a.id=b.id)

17,086

社区成员

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

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