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? -

file - Python: AttributeError: 'str' object has no attribute 'readlines' -

c# - Get the Class name in a class with atribute inside a attribute method -