select round(avg(total_amount),1) avg_amount,round(avg(cost),1) from ( select distinct order_id,total_amount,sale_price-total_amount cost from tb_product_info t1 #去重 left join (select t.order_id,event_time,product_id,uid,dense_rank()over(partition by uid order by event_time) rk,total_amount, sum(pri...