select res.date,count(res.date) count from (
select
(case dayofweek(om.create_date)
when 1 then '周日'
when 2 then '周一'
when 3 then '周二'
when 4 then '周三'
when 5 then '周四'
when 6 then '周五'
when 7 then '周六'
end ) date
from order_main om where (2 * 6378.137 * ASIN(SQRT(POW( SIN(( om.latitude - #{纬度})* PI()/ 360 ), 2 ) + COS( om.latitude * PI()/ 180 )* COS( #{纬度} * PI()/ 180 )* POW( SIN(( om.longitude - #{经度} )* PI()/ 360 ), 2 )))) <= 5 ) res group by res.date order by count desc limit 1
mysql数据库根据星期几分类统计
于 2023-02-14 13:21:47 首次发布