题解 | 统计用户从访问到下单的转化率

统计用户从访问到下单的转化率

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

with
    t1 as (
        select
            date(order_time) as date1,
            count(distinct user_id) as order_nums
        from
            order_tb
        group by
            date1
    ) ,
    
    t2 as (select
            date(visit_time) as date2,
            count(distinct user_id) as visit_nums
        from
            visit_tb
        group by
            date2
    )

    select
        t1.date1 as date,
        concat(round(t1.order_nums/t2.visit_nums*100,1),"%") as cr
    from t1
    join t2 on t1.date1=t2.date2
    order by date


全部评论

相关推荐

10-10 01:10
已编辑
深圳大学 测试开发
面了100年面试不知...:六月到九月,四个项目一个实习,是魔丸吗
投了多少份简历才上岸
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务