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

select
    o.date as date,
    concat (round(o.c / v.c * 100, 1), '%') as cr
from
    visit_tb v,
    (
        select
            date_format (order_time, '%Y-%m-%d') as date,
            count(distinct user_id) as c
        from
            order_tb
        group by
            date_format (order_time, '%Y-%m-%d')
    ) o,
    (
        select
            date_format (visit_time, '%Y-%m-%d') as date,
            count(distinct user_id) as c
        from
            visit_tb
        group by
            date_format (visit_time, '%Y-%m-%d')
    ) v
where
    o.date = v.date
group by
    o.date
order by
    date

全部评论

相关推荐

华为 终端bg通软 n*16 硕士985
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务