"Go" Oracle How to copy a table's SQL statement

Source: Internet
Author: User

Original link http://database.51cto.com/art/201004/192790.htm

The following article focuses on SQL statements that describe Oracle replicated tables, including how to replicate the table structure of SQL.
And how to copy the structure of the related table and copy the data SQL in the table.

as follows, table A is a table that already exists in the database, and B is a table that is ready to be copied from table A:1, copy only table structure sqlcreate table B as Select* fromAwhere 1<>1

2sqlcreate Table B, that is, copying the tables structure and copying the data in the table as Select* fromA

3, the Sqlcreate table B of the development field for Oracle replication tables as SelectRow_id,name,age fromAwhere 1<>1
The premise is that row_id,name,age are all columns of table A.4, copying the specified fields of the table and the data for those specified fields Sqlcreate table B as SelectRow_id,name,age fromA
Although the above statement can easily be based on the structure of a table to create a B table, but the index of a table can not be copied, you need to manually set up in B. 5, insert into will save the query results to an existing table insert into T2 (column1, Column2, ....)SelectColumn1, Column2, .... fromT1
The above related content is the Oracle copy table of SQL statement, I hope you can gain some.

"Editor's recommendation"

    1. The actual operation of parallel execution of the Oracle database
    2. Issues to be aware of in Oracle RAC configuration
    3. Specific ways to reinstall after Oracle removal
    4. About Oracle Memory Architecture Research
    5. An explanation of the installation and configuration of Oracle database

"Go" Oracle How to copy a table's SQL statement

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.