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
Post a Comment