SELECT INTO使用Oracle
我正在尝试使用Oracle做一个SELECT INTO。 我的查询是:
SELECT * INTO new_table FROM old_table; 但是我得到以下错误:
 SQL Error: ORA-00905: missing keyword 00905. 00000 - "missing keyword" 
任何想法有什么不对?
上面的标准行为应该和我原先想象的一样:但是,Oracle在他们自己的SQL方言中完全不同地实现了Oracle Docs on Insert … Select
如果NEW_TABLE已经存在,那么…
 insert into new_table select * from old_table / 
如果你想根据OLD_TABLE中的logging创buildNEW_TABLE …
 create table new_table as select * from old_table / 
  select into用于在pl / sql中将variables设置为字段值。 相反,使用 
 create table new_table as select * from old_table 
使用:
 create table new_table_name as select column_name,[more columns] from Existed_table; 
例:
 create table dept as select empno, ename from emp; 
如果表已经存在:
 insert into new_tablename select columns_list from Existed_table;