# 思路:先分组聚合求出所有指标,再通过窗口函数rank() 筛选评分最高的记录 SELECT city,driver_id,avg_grade,avg_order_num,avg_mileage from ( select * ,rank()over(partition by city order by avg_grade desc) posn from ( select city,driver_id ,round(avg(grade),1) avg_grade ,round(count(order_time)/count(distinct date(or...