一、新表不存在
1、create table cs as select * from t_aly_il_result ---備份結構和數據
2、create table cs1 as select * from t_aly_il_result where 1 = 0 ---復制結構
3、create table cs2 as select up_inst_id,aly_layer from t_aly_il_result --復制部分字段
二、新表已存在(以下必須先創建表)
前提條件:create table cs3 as select * from t_aly_il_result where 1 = 0 --表結構已存在
1、復制數據
select * from cs3 ---沒數據的表
insert into cs3 select * from t_aly_il_result; --復制數據到新表
2、select
*
into
new_table
from
old_table;
3、select
*
into
new_table
from
old_table where 1=2;