首页 > 其他 > 详细

select into from 与insert into select from区别

时间:2016-03-11 10:05:58      阅读:139      评论:0      收藏:0      [点我收藏+]
select *  into target_table from source_table;

insert into target_table(col1, col2)select col1, 5 from source_table

 

相同点:

1.以上两句都是将源表source_table的记录插入到目标表target_table

 

不同点:

1.(select into from)要求目标表target_table不存在,因为在插入时会自动创建

(insert into select form)要求目标表target_table存在,由于目标表已经存在;还可以插入常量。

 

http://www.myexception.cn/database/479886.html

select into from 与insert into select from区别

原文:http://www.cnblogs.com/xy-1988xcl/p/5264303.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!