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

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

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

select t1.order_date as date, concat(round(cnt1*100/cnt2, 1), "%") as cr
from (
    select count(distinct user_id) as cnt1, date(order_time) as order_date
    from order_tb
    group by date(order_time)
) t1
join (
    select count(distinct user_id) cnt2, date(visit_time) as visit_date
    from visit_tb
    group by date(visit_time)
) t2
on t1.order_date = t2.visit_date
order by t1.order_date asc

全部评论

相关推荐

02-11 14:29
已编辑
字节跳动_QA
Edgestr:这种的写代码最狠了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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