题解 | 有取消订单记录的司机平均评分
有取消订单记录的司机平均评分
https://www.nowcoder.com/practice/f022c9ec81044d4bb7e0711ab794531a
#目标司机 with a as (select distinct driver_id from tb_get_car_order where mileage is null and date_format(order_time,'%Y%m')='202110') select ifnull(driver_id,'总体'),round(avg(grade),1) as avg_grade from tb_get_car_order where driver_id in (select driver_id from a) and grade is not null group by driver_id with rollup
三刷 with rollup 之前不能加order by