類似與sql server 的語句,從乙個表中取得一些資料匯入到另乙個新錶或者已經存在的表
sql server :
select [column1, column2, ...] into new_table from old_table ; -- 加入到新錶中
insert into end_table[column1, column2, ...] select [column1, column2, ...] from old_table; -- 加入到已經存在的表中,可以是某幾列,或者所有的列
oracle:
create table new_table as
select * from old_table;
insert into end_table select * from old_table;
從一張表資料匯入到另一張表
1 insert into select語句 語句形式為 insert into table2 field1,field2,select field1 field2 from table1 或者 insert into table2 select from table1 注意 1 要求目標表tabl...
從一張表中複製資料到另一張表中
分為兩種情況,一種是目標表不存在,另一種是目標表已存在,語法是不同的。分別以sqlserver和oracle為例,兩者略有不同。sqlserver中,如果目標表不存在 select into新錶名from舊表名 sqlserver中,如果目標表已存在 insertinto新錶名select from...
怎麼從一張表中查詢資料插入到另一張表中
如果兩表字段相同,則可以直接這樣用。insert into table a select from table b 如果兩表字段不同,a表需要b中的某幾個字段即可,則可以如下使用 insert into table a field a1,field a2,field a3 select field ...