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
经典!!!!!