update a set a=(select nvl(max(f),a) from b where b=a.b and c=a.c and d=a.d and e=a.e)
上句应该是对的,不过加nvl有什么用吗?
不加nvl会把不满足条件的记录更新成null
update a set a=(select max(f) from b where b=a.b and c=a.c and d=a.d and e=a.e) where exists ( select 1 from b where b=a.b and c=a.c and d=a.d and e=a.e)这样不会全表更新
set a=(select max(f) from b where b=a.b and c=a.c and d=a.d and e=a.e)
where exists (
select 1 from b where b=a.b and c=a.c and d=a.d and e=a.e)这样不会全表更新