hive按月/周统计

 substr(col,1,7) 分组

例如

select substr(t.UPDATE_TIME,1,7) as months,sum(t.tot_modal) as sums
from test t
group by substr(t.UPDATE_TIME,1,7)

原文地址:https://www.cnblogs.com/cailingsunny/p/12025230.html