http://cache.baiducontent.com/c?m= 9d78d513d99e01fc09b3c3690d67c0161343f0652ba1d4020ed08449e3732b42501195ac26520774d5d20c6116df3f4b99fa2235775d2feddd8eca5dd cc88f3579db6167204fc71605d36ea8c817639c37902db8f246fae9b0748eaed0d0dd5655d7500e7a85fb894d00639029af&p= C3759a46d4c719b149a5ce2d0216d57a&newp=91769a45d4dd50f946bd9b7d0f12c9245c5bc52151d0da0b6e828d&user= Baidu&fm=sc&query=oracle+%b8%b4%d6%c6%b1%ed%b4%b4%bd%a8&qid=&p1=1 This article focuses on the actual application of SQL statements for Oracle replicated tables, This article takes table A to demonstrate that B is preparing a table for the creation of replication based on table A. The following is the specific content of the article. 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. The following is a detailed description of the relevant content, I hope you read the following content will be harvested. 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. sql that replicates only the table structure
- CREATE TABLE B as select * from a where 1<>1
2. sql that replicates the table structure and replicates the data in the table
- CREATE TABLE B as select * from a
3. SQL for the development fields of Oracle replication tables
- CREATE TABLE B as select Row_id,name,age from a where 1<>1
The premise is that Row_id,name,age is the column 4 of Table A, the SQL that replicates the specified fields of the table and the data for those specified fields
- CREATE TABLE B as select Row_id,name,age from a
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 the existing table
- Insert into T2 (column1, Column2, ....)
Select Column1, Column2, .... from t1
The above related content is the Oracle copy table of SQL statement, I hope you can gain some.
SQL statement created by Oracle replication table