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

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;

全部评论

相关推荐

mjasjon:这种trash中厂 简历过筛概率比大厂还低(除阿里系)
投递哔哩哔哩等公司6个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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