· 9 years ago · Sep 30, 2016, 10:04 AM
1CREATE EXTERNAL TABLE IF NOT EXISTS db.tableB LIKE db.tableA;
2
3insert overwrite table db.tableB partition (yymmddval, yymmddcrt)
4select *
5from db.tableA
6where 1=1
7and yymmddval between '${start}' and '${end}' ; # date 1 to date 7
8
9insert into table db.tableB partition (yymmddval, yymmddcrt)
10select *
11from db.tableA
12where 1=1
13and yymmddval between '${start}' and '${end}' ; # date 11 to date 17