题解 | #有取消订单记录的司机平均评分#

有取消订单记录的司机平均评分

https://www.nowcoder.com/practice/f022c9ec81044d4bb7e0711ab794531a

with t as(
    select driver_id, grade
    from tb_get_car_order
    where driver_id in (select driver_id from tb_get_car_order where fare is null and date_format(order_time, '%Y-%m') = '2021-10') and grade is not null
)

select driver_id, round(avg_grade, 1) avg_grade
from (select driver_id, avg(grade) avg_grade
from t
group by driver_id
union
    select '总体' driver_id, avg(grade) avg_grade
    from t
) t2 

全部评论

相关推荐

服从性笔试吗,发这么多笔,现在还在发。
蟑螂恶霸zZ:傻 x 公司,发两次笔试,两次部门匹配挂,
投递金山WPS等公司10个岗位 >
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务