Home > Database > Mysql Tutorial > body text

Oracle使用select语句复制表

WBOY
Release: 2016-06-07 17:18:12
Original
1046 people have browsed it

Oracle使用select语句复制表,要求目标表Table2必须存在,由于目标表Table2已经存在,所以我们除了插入源表Table1的字段外,还可以

1.INSERT INTO SELECT语句

语句形式为:Insert into Table2(field1,field2,...) select value1,value2,... from Table1

要求目标表Table2必须存在,由于目标表Table2已经存在,所以我们除了插入源表Table1的字段外,还可以插入常量。示例如下:

INSERT INTO SELECT语句复制表数据

2.SELECT INTO FROM语句

语句形式为:SELECT vale1, value2 into Table2 from Table1

要求目标表Table2不存在,因为在插入时会自动创建表Table2,并将Table1中指定字段数据复制到Table2中。示例如下:

SELECT INTO FROM创建表并复制表数据

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template