批量添加:
insert into A(a,b,c) select t.a,t.b,t.c from B t
批量修改:
update T1 set T1.A列=
(select T2.A列 from T2 where T2.B列=T1.A列 and rounum<=1)
where exists(select 1 from T2 where T2.B列=T1.A列 ) --加上这句,避免勿更新一些资料!
insert into A(a,b,c) select t.a,t.b,t.c from B t
批量修改:
update T1 set T1.A列=
(select T2.A列 from T2 where T2.B列=T1.A列 and rounum<=1)
where exists(select 1 from T2 where T2.B列=T1.A列 ) --加上这句,避免勿更新一些资料!
本文介绍如何使用SQL进行数据的批量添加与修改操作,包括通过子查询实现数据的批量插入及利用EXISTS条件避免误更新的方法。
5499

被折叠的 条评论
为什么被折叠?



