题解 | #有取消订单记录的司机平均评分#
有取消订单记录的司机平均评分
http://www.nowcoder.com/practice/f022c9ec81044d4bb7e0711ab794531a
SELECT driver_id, round(avg(grade),1) as avg_grade from tb_get_car_order where driver_id in (select distinct driver_id from tb_get_car_order o where start_time is null) group by driver_id union ALL SELECT '总体' as driver_id, round(avg(grade),1) as avg_grade from tb_get_car_order where driver_id in (select distinct driver_id from tb_get_car_order o where start_time is null)