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

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

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

# SELECT DISTINCT driver_id
# FROM tb_get_car_order
# WHERE start_time IS NULL

(SELECT driver_id,ROUND(AVG(grade),1) AS avg_grade
FROM tb_get_car_order
WHERE driver_id IN(
    SELECT driver_id
    FROM tb_get_car_order
    WHERE start_time IS NULL
)
GROUP BY driver_id
ORDER BY driver_id)
UNION
(SELECT '总体' AS driver_id,ROUND(AVG(grade),1) AS avg_grade
FROM tb_get_car_order
WHERE driver_id IN(
    SELECT driver_id
    FROM tb_get_car_order
    WHERE start_time IS NULL
))

怎么就过啦?哈哈哈哈哈哈

全部评论

相关推荐

我也曾抱有希望:说的好直白
点赞 评论 收藏
分享
10-09 22:05
666 C++
找到工作就狠狠玩CSGO:报联合国演讲,报电子烟设计与制造
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务