How to calculate Date difference in Hive

后端 未结 4 2097
梦如初夏
梦如初夏 2021-02-01 04:17

I\'m a novice. I have a employee table with a column specifying the joining date and I want to retrieve the list of employees who have joined in the last 3 months. I understand

4条回答
  •  忘掉有多难
    2021-02-01 05:06

    datediff(to_date(String timestamp), to_date(String timestamp))
    

    For example:

    SELECT datediff(to_date('2019-08-03'), to_date('2019-08-01')) <= 2;
    

提交回复
热议问题