This section describes the SQL statements used to copy a table from an Oracle database, including the SQL statements used to copy the table structure. And how to copy the structure of the relevant table and copy the data SQL in the table. The following content
This section describes the SQL statements used to copy a table from an Oracle database, including the SQL statements used to copy the table structure. And how to copy the structure of the relevant table and copy the data SQL in the table. The following content
The following article describes the SQL statements used to copy a table from an Oracle database, including the SQL statements used to copy the table structure. And how to copy the structure of the relevant table and copy the data SQL in the table. The following is a detailed description of the relevant content. I hope you will gain some benefits after browsing the following content.
As shown in the following figure, Table a is an existing table in the database, and table B is the table to be copied and created based on table:
1. copy only the SQL statements of the Table Structure
Create table B as select * from a where 1 <> 1
2. SQL statement used to copy the table structure and data in the table
Create table B as select * from
3. SQL statement used to create fields for Oracle replication tables
Create table B as select row_id, name, age from a where 1 <> 1
The premise is that row_id, name, and age are all columns in table.
4. Copy the specified fields of the table and the SQL statement of the data of these specified fields
Create table B as select row_id, name, age from
Although the preceding statements can easily replicate and Create Table B according to the structure of Table a, the index of Table a cannot be copied and must be manually created in table B.
5. insert into saves the query result to an existing table.
Insert into t2 (column1, column2,...) select column1, column2,... from t1
The above content is an introduction to the SQL statements used to copy tables from Oracle. I hope you will find some gains.