SQL "SELECT INTO" 与 "INSERT INTO SELECT" 语句的比较
原文英文,约200词,阅读约需1分钟。发表于: 。The "SELECT INTO" statement copies data from one table into a new table. the syntax of the statement is as follows below SELECT * INTO newtable [IN externaldb] FROM oldtable WHERE...
SELECT INTO 语句用于将数据从一个表复制到新表,语法为:SELECT * INTO newtable FROM oldtable WHERE condition。可以选择特定列。INSERT INTO SELECT 语句用于将数据插入到现有表中,要求数据类型匹配,不影响目标表中的现有记录。总结:SELECT INTO 创建新表,INSERT INTO SELECT 用于现有表之间的数据转移。