Find information 365 days ago (hive) or (impala)

Viewed 84

Please tell me how to find information for the last 365 days from the current day in hive. Found such a function for months

select * from table 
where operdate>=add_months(current_date,-12)

but for days I don’t know. And if you know, please write how you can do it through impala.

1 Answers

Use date_add or date_sub function

date_add(current_date, -365) 

or

date_sub(current_date, 365)

See Hive manual and Impala manual.

Related