Oracle&SQL Server中的select into方法

来源:互联网 发布:淘宝采集赚钱怎么弄 编辑:程序博客网 时间:2024/05/22 16:07

 INSERT INTO 表名(字段名1, 字段名2, ...) SELECT 字段名1, 字段名2, ...FROM 另外的表名;

比较有用的一个例子是:

INSERT INTO 表名(PK, 字段名2, ...) SELECT 序列名.nextVal, 字段2值, ...FROM dual.sql server 中的实现:把 old_table 里满足条件的记录插入到另一个表,如下:select * into new_table from old_table where ....