SELECT *,count(1),SUM(if(ARRIVE.ARRIVE_TIME != '无',1,0)) as s FROM lt_cleanroute_point_arrive AS ARRIVE WHERE DATE_FORMAT(data_dt,'%Y-%m') = '2022-12' and TIME(data_dt) BETWEEN '00:00:00' AND '12:00:00' GROUP BY NAME ORDER BY data_dt
分组后显示的日期会隐藏很多时期,只显示部分,注意这个细节。
本文来自博客园,作者:狂躁的键盘,转载请注明原文链接:https://www.cnblogs.com/wangweiip/p/16994143.html