SELECT coalesce(time, '总数') as statistic_time, num
FROM ( SELECT DATE_FORMAT(create_time, '%Y-%m-%d %T:%f') as time , COUNT(*) AS num
FROM customer
WHERE customer_phone > 17862462917
GROUP BY time
WITH ROLLUP
ORDER BY time) as statistic_customer_table
这样会多花100ms的时间比下面那个
SELECT DATE_FORMAT(create_time, '%Y-%m-%d %T:%f') as time , COUNT(*) AS num
FROM customer
WHERE customer_phone > 17862462917
GROUP BY time
WITH ROLLUP
ORDER BY time;