hadoop - How to subtract months from date in HIVE -


i looking method helps me subtract months date in hive

i have date 2015-02-01. need subtract 2 months date result should 2014-12-01.

can guys me out here?

 select add_months('2015-02-01',-2); 

if need go first day of resulting month:

 select add_months(trunc('2015-02-01','mm'),-2); 

Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

javascript - Why Selenium can't find an element that is graphically visible -

angular - Angular2 Router: Cannot find primary outlet to load 'HomeComponent' -