疑惑| #10月的新户客单价和获客成本#我的答案哪里有问题

10月的新户客单价和获客成本

https://www.nowcoder.com/practice/d15ee0798e884f829ae8bd27e10f0d64

select 
round(avg(t.avg_amount1),1) avg_amount
,round(avg(t.avg_cost1),1) avg_cost
from
(
    select 
    uid
    ,min(event_time)
    ,avg(total_amount) avg_amount1
    ,sum(price*cnt)-avg(total_amount) avg_cost1

    from tb_order_detail de
    left join tb_order_overall ov 
    on  de.order_id=ov.order_id 
    where substring(event_time,1,7)='2021-10'
    group by 1
) t





全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务