以几分钟中分段 向下取整 然后乘以要分组的时间
SELECT *, DATE_FORMAT(
concat(date(create_time), ' ', HOUR (create_time), ':', floor(MINUTE (create_time) / ${minute} ) * ${minute}), '%Y-%m-%d %H:%i'
) AS time
FROM t_soc_service_invoke
以几小时分段
SELECT *,DATE_FORMAT(concat(
date( create_time ), ' ', FLOOR( HOUR (create_time ) / ${hour} ) * ${hour} ), '%Y-%m-%d %H:%00:00' ) AS time
from t_soc_service_invoke