一、Oracle数据库中,把一张表的查询结果直接生成并导入一张新表中。
 
例如:现有只有A表,查询A表,并且把结果导入B表中。使用如下SQL语句:
 
create table b as select * from a
 
二、Oracle数据库中支持把查询结果导入到另外一张表中。
 
例如:有两个表AB
 
1)如果两个表的表结构是否相同,但要插入的字段类型相同:
 
(1)把A表的全部字段数据插入到B表中:
insert into B select * from A;
 
(2)把A表中某些字段的数据插入B表中:
insert into B(字段名)(select 字段名 from A)
 
2)果不在同一个schema下请在表名前加上schema,例如有schema ab
 
insert into b.B select * from a.A

相关文章:

  • 2021-09-21
  • 2021-10-20
  • 2021-07-14
  • 2021-10-17
  • 2020-07-09
  • 2021-10-02
  • 2021-12-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2021-10-21
  • 2022-12-23
相关资源
相似解决方案