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

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -