业务场景:
tableA:
id | tel | name |
1 | 13700000000 | 张三 |
2 | 13700000001 | 李四 |
tableB:
b_id | b_tel | b_name |
1 | 0536-1111111 | 张三 |
2 | 0532-00000000 | 李四 |
用b表的tel更新a表的tel
update tableA a set a.tel= (select b.b_tel from tableB b
where b.b_id= a.id and b.b_id is not null and rownum = 1) ;