hive查询以查找当月的天数

时间:2016-08-05 11:13:31

标签: hive

您能否帮我写一个配置单询问来查找当月的总天数,工作日数和周末数。

提前致谢。

1 个答案:

答案 0 :(得分:0)

通过这样的方式,您可以获得当月的天数:

SELECT datediff(CONCAT(y, '-', (m + 1), '-', '01'), CONCAT(y, '-', m, '-', '01')) FROM (SELECT month(current_date) as m, year(current_date) as y, day(current_date)) t