请教下我的写法有什么问题呢?select city,driver_id,avg_grade,avg_order_num,avg_mileage from(select city,driver_id, round(avg(grade),1) as avg_grade, round(count(order_id)/count(distinct date(order_time)),1) as avg_order_num, round(sum(mileage)/count(distinct date(order_time)),3) as avg_mileage, rank()over(partition by city order by round(avg(grade),1) desc) as rn from tb_get_car_record t1 join tb_get_car_order t2 using(order_id) group by city,driver_id order by avg_grade desc )as a where rn = 1 order by avg_order_num
点赞

相关推荐

点赞 评论 收藏
分享
hso_:哈哈哈哈哈哈我没offer一样在同一道题开喷了
投递深圳同为数码等公司10个岗位
点赞 评论 收藏
分享
牛客网
牛客企业服务