substr(col,1,7) 分组
例如
select substr(t.UPDATE_TIME,1,7) as months,sum(t.tot_modal) as sumsfrom test tgroup by substr(t.UPDATE_TIME,1,7)