方法一:
create table 表名 as(取值逻辑sql) with date ;
————distributed by (分布字段)
方法二(针对已经有的表):
delect from 库名.表名 where date_dt=系统时间
insert into 库名.表名(字段)
取值逻辑sql;
备注:可以多次插入
方法三(针对插入时用临时表):
delect from 库名.表名 where date_dt=系统时间
insert into 库名.表名(字段)
with 临时表名 as (取值逻辑)
取值逻辑sql(直接在关联中用临时表);
方法三:
drop table if exists 表名;
creat table 表名(字段 类型,字段 类型)
———with(oids=false,appendonly=true,orientation=row,compresstype=zlib,compresslevel=5)压缩数据
insert into 表名(字段)
取值逻辑;