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

with tmp1 as (
select 
time
,max(rn) as rn1
from(
select 
user_id
,substr(order_time,1,10) as time
,dense_rank() over(partition by substr(order_time,1,10) order by user_id) as rn
from order_tb) t
group by time),

tmp2 as (
select 
time
,max(rn) as rn2
from(
select 
user_id
,substr(leave_time,1,10) as time 
,dense_rank() over(partition by substr(leave_time,1,10) order by user_id) as rn
from visit_tb) t
group by time )

select 
t1.time as date
,concat(round(((t1.rn1 / t2.rn2) * 100),1),'%') as cr
from tmp1 as t1
inner join tmp2 as t2
on t1.time = t2.time;

全部评论

相关推荐

点赞 评论 收藏
分享
05-07 19:10
已编辑
中国科学技术大学 C++
silly01:现在先去 momenta,8-9月去鹅找日常实习,八股文算法背好了你这随便进。不过建议补充一下后端知识,MySQL、Redis看下八股,再补个6824,加点go后台的技术栈,9月随便进大厂。CPP后端只能来WXG
点赞 评论 收藏
分享
每晚夜里独自颤抖:把华北改为华南再试一试,应该就没啥问题了。改完可能都不用投,别人主动联系了。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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