select round(avg(total_amount),1), round(avg(cost),1) from ( select order_id, uid, total_amount, event_time from ( select order_id, uid, total_amount, event_time, row_number() over ( partition by uid order by event_time ) as rn from tb_order_overall ) a where rn = 1 and date_format(event_time, '%Y-%...