创建一个表new_table和old_table表结构一样(只复制表结构,没有old_table的记录)

create table new_table as select * from old_table  where 1=0;

 

创建一个表new_table和old_table表结构一样(复制表结构和表的数据,有old_table的记录)

create table new_table as select * from old_table;

 

复制一个表到另一个表

insert into new_table select * from old_table;

 

创建视图,删除视图

create or replace view **_view as select * from **table;
drop view **_view;

 

创建临时表

create  global  temporary  table  tablename  on  commit  preserve  rows  as  select  *  from  others_table

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
猜你喜欢
  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2021-11-13
  • 2021-12-24
  • 2021-09-06
  • 2021-11-13
相关资源
相似解决方案