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;