工作中遇到了一个数据统计的场景,统计数据的小时分布。 有两种方式: SUBSTRING select substring(`time`, 1, 7) as month, count(*) from table_xxx group by substring