比如,如果B表中有满足条件的数据,才修改A的表:
update A set col1 = xxx where exists(select 1 from B where b.col2 = ‘yyy’);
或者两表关联:
update A set col1 = xxx where exists(select 1 from B where b.col2 = ‘yyy’ and b.col1 = a.col1);
update A set col1 = xxx where exists(select 1 from B where b.col2 = ‘yyy’);
或者两表关联:
update A set col1 = xxx where exists(select 1 from B where b.col2 = ‘yyy’ and b.col1 = a.col1);