oracle如何通过两个表关联,修改其中一表中某列的数据?

[复制链接]
查看11 | 回复2 | 2010-3-2 15:06:05 | 显示全部楼层 |阅读模式
update a set a.e=(select b.h from b where b.g=a.g) where a.g in (select b.g from b)或者update a set a.e=(select b.h from b where b.g=a.g) where exists (select null from b where b.g=a.g)需要保证a,b表一对一对应关系,如不是不可以这么写条件那里看需要写了,如果a表大,用in ,反之用exists
回复

使用道具 举报

千问 | 2010-3-2 15:06:05 | 显示全部楼层
update A set A.E=(select B.H from B where A.G=B.G)
回复

使用道具 举报

千问 | 2010-3-2 15:06:05 | 显示全部楼层
update A set A.E=B.H where A.G=B.G
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行