以下的文章主要是介紹
oracle
複製表的
sql語句,其中包括如何複製表結構的
sql。以及如何複製相關表的結構又複製表中的資料
sql
如下,表a是
資料庫中已經存在的表,
b是準備根據表
a進行複製建立的表: 1
、只複製表結構的
sql
1.create table
b as select* from a where 1
<>1
2、即複製表結構又複製表中資料的
sql
1.create table b as select * from a 3
、oracle
複製表的制定欄位的
sql
1.create table b as select row_id,name,agefrom a where 1
<>1
前提是row_id,name,age都是a
表的列
4、複製表的指定欄位及這些指定欄位的資料的
sql
1.create table b as select row_id,name,agefrom a
以上語句雖然能夠很容易的根據
a表結構複製建立
b表,但是
a表的索引等卻複製不了,需要在
b中手動建立。 5
、insert into
會將查詢結果儲存到已經存在的表中 1.
insert into t2(column1, column2, ....) select column1, column2, .... from t1
Oracle如何複製表的sql語句
表a是資料庫中已經存在的表,b是準備根據表a進行複製建立的表 1 只複製表結構的sql create table b as select from a where 1 1 2 即複製表結構又複製表中資料的sql create table b as select from a 3 oracle複製表的...
Oracle 複製表 SQL語句
如下,表a是資料庫中已經存在的表,b是準備根據表a進行複製建立的表 1 只複製表結構的sql create table b as select from a where 1 12 即複製表結構又複製表中資料的sql create table b as select from a3 複製表的制定欄位的...
oracle複製表的sql語句
如下,表a是資料庫中已經存在的表,b是準備根據表a進行複製建立的表 1 只複製表結構的sql create table b as select from a where 1 1 2 即複製表結構又複製表中資料的sql create table b as select from a 3 複製表的制定欄...