mysql coalesce 配合别名,取消掉null
SELECT coalesce(time, '总数') as statistic_time, numFROM ( 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 ROLLUPORDER BY time) as statistic_customer_.
原创
2020-08-05 11:08:31 ·
186 阅读 ·
0 评论