【oracle】select into from和insert into select的区别

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/debimeng/article/details/86182030

select into from和insert into select的区别

相同:
都是用来复制表的;

不同:
select into from要求目标不存在,因在插入时会自动创建;
insert into select from需要目标表存在;

语法和例子:
select into语句
select vale1,vale2.... into table2 from table1;
如:
select a,c into table2 from table1;

insert into select语句
insert into table2(filed1,field2,.....) select value1,value2,...... from table1;
如:
insert into table2(a,c,d) select a,c,5 from table1;

猜你喜欢

转载自blog.csdn.net/debimeng/article/details/86182030