1、只拷贝表结构,不拷贝数据

select * into b from a where 1<>1;

 

2、表数据迁移

      表b已经存在:

insert into b (d, e, f) select a, b, c from a;

     表b原先不存在:

create table b (select a, b, c from a);

 

3、创建临时表

      创建临时表的语法很简单,临时表存在内存中,会话结束即消失:

create temporary table a (...);

 

4、创建视图

      视图属于数据库:

create view test.myView as select a, b from a;

相关文章:

  • 2021-12-10
  • 2021-11-23
  • 2022-01-21
  • 2022-01-30
  • 2022-01-29
  • 2022-02-24
  • 2022-12-23
猜你喜欢
  • 2021-09-16
  • 2021-11-24
  • 2021-12-29
  • 2022-02-12
  • 2021-11-18
  • 2021-08-18
相关资源
相似解决方案