Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. CREATE EXTERNAL TABLE IF NOT EXISTS db.tableB LIKE db.tableA;
  2.  
  3. insert overwrite table db.tableB partition (yymmddval, yymmddcrt)
  4. select *
  5. from db.tableA
  6. where 1=1
  7. and yymmddval between '${start}' and '${end}' ; # date 1 to date 7
  8.  
  9. insert into table db.tableB partition (yymmddval, yymmddcrt)
  10. select *
  11. from db.tableA
  12. where 1=1
  13. and yymmddval between '${start}' and '${end}' ; # date 11 to date 17
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement