1.使用ALL操作符执行多表插入. 当使用ALL操作符执行多表插入时,在每个条件子句上都要执行into后面的子查询,示例如下: insert all when deptno = 10 then into dept10 when deptno = 20 then into dept20 when deptno = 30 then into dept30 when job = 'CLERK' then into clerk else into other select * from emp; 2.使用FIRST操作符执行多表插入当使用FIRST操作符执行多表插入时,如果数据已经满足了先前的条件,并已经插入到某表中,则该条数据在后续插入中将不再被使用,示例如下: insert first when deptno = 10 then into dept10 when deptno = 20 then into dept20 when deptno = 30 then into dept30 when job = 'CLERK' then into clerk else into other select * from emp; 注意:在ORACLE9i之前,insert操作只能执行单表操作.
使用insert向多表插入数据
最新推荐文章于 2024-04-17 14:17:33 发布