我突然发现个问题,好多人连了第一个表。但好像第一个表根本没用上。 select round(avg(实付),1),round(avg(优惠),1) from ( select order_id,total_amount 实付,sum(price*cnt)-total_amount 优惠 from tb_order_detail join tb_order_overall using(order_id) where (uid,event_time) in (select ...