墨色风雨
时间分组,排序字段不清,姑且按price排序吧select
mtime,sum(price),sum(number),
substring_index(group_concat(price order by price),',',1) min_price,
substring_index(group_concat(price order by price),',',-1) max_pricefrom table group by mtime;