SELECT sum(mun),max from (
select (ceil(distance/500)-1)*500 as min,
ceil(distance/500)*500 as max,
count(*) mun
from tablename where date_format(alarm_date, '%Y-%m-%d') =date_format('2023-02-03', '%Y-%m-%d') group by ceil(distance/20)
) t GROUP BY max
;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)