当前位置:网站首页>daily sql - user retention rate for two days
daily sql - user retention rate for two days
2022-08-11 07:13:00 【Eating too much sugar will not gain weight】
Two-day retention rate
Data column:
id device_id quest_id result date
select count(date2) / count(date1) as avg_ret
from
(select distinct d1.device_id, d1.date as date1, d2.date as date2
from question_practice_detail d1
leftjoin(
select distinct device_id, date
from question_practice_detail) d2
on d1.device_id = d2.device_id
and date_add(d1.date, interval 1 days) = d2.date
)a
select avg(if(datediff(date2,date1)= 1,1,0)) as avg_ret
from(
select distinct device_id,date as date1,lead(date) over(partition by device_id orderby date) as date2
from (select distinct device_id,date from question_practice_detail) b
)a
边栏推荐
- 求过去半年内连续30天以上每天都有1000元以上成交的商铺
- Open Set Domain Adaptation 开集领域适应
- 抖音关键词搜索商品-API工具
- 每日sql-求2016年成功的投资总和
- Xshell如何连接虚拟机
- 损失函数——负对数似然
- 【LeetCode】2034. 股票价格波动(思路+题解)双map
- SECURITY DAY06 ( iptables firewall, filter table control, extended matching, typical application of nat table)
- detectron2,手把手教你训练mask_rcnn
- Raspberry Pi set static IP address
猜你喜欢
随机推荐
空间点模式方法_一阶效应和二阶效应
矩阵分析——微分、积分、极限
MySQl进阶之索引结构
HCIP实验(pap、chap、HDLC、MGRE、RIP)
HCIP-BGP的选路实验
HCIA知识复习
arcgis填坑_3
window7开启远程桌面功能
HCIP MGRE\OSPF综合实验
损失函数——负对数似然
HCIP experiments (pap, chap, HDLC, MGRE, RIP)
核方法 Kernel method
The ramdisk practice 1: the root file system integrated into the kernel
HCIP OSPF/MGRE Comprehensive Experiment
deepin v20.6+cuda+cudnn+anaconda(miniconda)
知识蒸馏Knownledge Distillation
华为防火墙-6
华为防火墙-2-状态检测与会话
京东商品详情API调用实例讲解
《Generative Adversarial Networks》








