oracle实现同时多表插入

来源:互联网 发布:复杂网络可控性 编辑:程序博客网 时间:2024/05/02 03:47

oracle实现同时多表插入

 

最简单的,一条SELECT结果向多个表中插入:

 

insert all
into test1(id,name,sex,cj)
into test2(id,name,sex,cj)
into test3(id,name,sex,cj)
select id,name,sex,cj from test ;

 

 

依据条件实现:

 

insert all
when id <10 then
into test1(id,name,sex,cj)
when id >10 and id<50  then
into test2(id,name,sex,cj)
when id >50 and id<1000  then
into test3(id,name,sex,cj)
select id,name,sex,cj from test

 

经典!!!!!

原创粉丝点击