SQL> create table t1 as select * fromemp;
Table created.
SQL> create table t2 as select * fromemp;
Table created.
SQL> insert all into t1 select * fromemp;
14 rows created.
SQL> insert all when sal>2000 theninto t1 when sal<2000 then into t2 select * from emp;
14 rows created.
Insert all ----不带条件
SQL> insert all intoa2(no,sub_no,repay,period)
2 values(no,sub_no,repay,period)
3 into a3(no,sub_no,period)
4 values(no,'1234',period)
5 select * from a1;
16 rows created.
Insert all ----带条件
SQL> insert all
2 when period=0 then
3 into a2(no,sub_no,repay,period)
4 values(no,sub_no,repay,period)
5 else
6 intoa3(no,sub_no,repay,period)
7 values(no,sub_no,repay,period)
8 select no,sub_no,repay,periodfrom a1;
8 rows created.
---insert first
SQL> insert first
2 when period=0 then
3 into a2(no,sub_no,repay,period)
4 values(no,sub_no,repay,period)
5 when sub_no='2104' then
6 into a3(no,sub_no,repay,period)
7 values(no,sub_no,repay,period)
8 select no,sub_no,repay,periodfrom a1;
8 rows created.