区段统计 mysql 语句 case when then end as
EXPLAIN SELECT COUNT(*),
CASE
WHEN device_width > 729 THEN '>729'
WHEN device_width BETWEEN '720' AND '729' THEN '720-729'
WHEN device_width BETWEEN '710' AND '720' THEN '710-720'
ELSE '<710'
END AS t
FROM weimeng_click_record
GROUP BY
CASE
WHEN device_width > 729 THEN '>729'
WHEN device_width BETWEEN '720' AND '729' THEN '720-729'
WHEN device_width BETWEEN '710' AND '720' THEN '710-720'
ELSE '<710'
END