【问题标题】:Number of Days in a month HIVE [duplicate]HIVE一个月中的天数[重复]
【发布时间】:2021-05-30 12:30:36
【问题描述】:

有人可以告诉我一个简单的方法来根据 current_date 在 HIVE SQL 中获取一个月中的天数。 例如2021-02-16 = 28 天,2021-06-30 = 30 天等

【问题讨论】:

标签: sql date hive hiveql


【解决方案1】:

使用

day(last_day(current_date))

last_day(date) 返回最后一天的日期,day(date) 返回日期的天部分,int

在此处查看手册:Language Manual - Date Functions

【讨论】:

    猜你喜欢
    • 2014-05-08
    • 1970-01-01
    • 2013-07-07
    • 1970-01-01
    • 1970-01-01
    • 2012-11-05
    • 2012-02-24
    • 2013-11-25
    相关资源
    最近更新 更多