oracle实现同时多表插入

    技术2022-05-20  45

    oracle实现同时多表插入

     

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

     

    insert allinto 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 allwhen id <10 theninto test1(id,name,sex,cj)when id >10 and id<50  theninto test2(id,name,sex,cj)when id >50 and id<1000  theninto test3(id,name,sex,cj)select id,name,sex,cj from test

     

    经典!!!!!


    最新回复(0)