select into from 与insert into select from区别

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

原文地址:https://www.cnblogs.com/xy-1988xcl/p/5264303.html