【发布时间】:2021-05-30 12:30:36
【问题描述】:
有人可以告诉我一个简单的方法来根据 current_date 在 HIVE SQL 中获取一个月中的天数。 例如2021-02-16 = 28 天,2021-06-30 = 30 天等
【问题讨论】:
-
这能回答你的问题吗? Find last day of a month in Hive
有人可以告诉我一个简单的方法来根据 current_date 在 HIVE SQL 中获取一个月中的天数。 例如2021-02-16 = 28 天,2021-06-30 = 30 天等
【问题讨论】:
使用
day(last_day(current_date))
last_day(date) 返回最后一天的日期,day(date) 返回日期的天部分,int
在此处查看手册:Language Manual - Date Functions
【讨论】: