当前位置:网站首页>找出连续7天登陆,连续30天登陆的用户
找出连续7天登陆,连续30天登陆的用户
2022-06-28 18:39:00 【南湖渔歌】
小红书笔试,电信云面试:
/* use dw; SELECT * from fct_sales fs limit 10; SELECT min(dimDateID) , max(dimDateID) from fct_sales fs limit 10; -- 20170602 20170830 */
select * ,count(1)over() as cnt
from
(
select user_id
,dts
,count(1) as num
from
(
select user_id
,date_sub(log_in_date, interval ranks day) dts
from
(
SELECT user_id
,log_in_date
,row_number()over(partition by user_id order by log_in_date asc) as ranks
from (
select DISTINCT dimMemberID as user_id, date(dimDateID) as log_in_date
from fct_sales
where timestampdiff(day, date(dimDateID),(select max(dimDateID) from fct_sales)) <= 30
and dimMemberID <> 0
) data_source
) t
) a
group by user_id,dts
) b
where num in (7,30);
边栏推荐
- devpi
- Michael Wooldridge, professeur à l'Université d'Oxford: comment la communauté de l'IA voit les réseaux neuronaux depuis près de 40 ans
- Seata implementation of sharing JDBC distributed transaction
- Shell 未知汇总1
- Opencv中使用Tracker实现物体跟踪
- 深入解析kubernetes中的选举机制
- 手动备份和还原DHCP服务器
- 泰山OFFICE技术讲座:WORD奇怪的字体高度
- AOSP清华镜像下载错误解决
- 微软独家付费功能,也被完美解锁了
猜你喜欢

使用Karmada实现Helm应用的跨集群部署

3D可旋转粒子矩阵

基于管线的混合渲染

Opengauss kernel: analysis of SQL parsing process

闭包的理解

leetcode 1423. Maximum Points You Can Obtain from Cards(从牌中能得到的最大点数和)

Cvpr2022 | Zhejiang University and ant group put forward a hierarchical residual multi granularity classification network based on label relation tree to model hierarchical knowledge among multi granu

SMARCA2抗体研究:Abnova SMARCA2 单克隆抗体方案

618 activity season - the arrival of special discounts for hundreds of low code platforms

Enhancing steam and engineering education from theory to practice
随机推荐
Analyzing the practical development of robot teaching
OOM out of memory 内存溢出
牛津大學教授Michael Wooldridge:AI社區近40年如何看待神經網絡
PHP使用栈解决迷宫问题
About Significance Tests
模块化操作
ANR Application Not Responding
Mybayis之核心主件分析
Can I open an account today and buy shares today? Is it safe to open an account online?
打破学科之间壁垒的STEAM教育
Lumiprobe非荧光炔烃研究丨DBCO NHS 酯
微博评论的高性能高可用计算架构方案
Qt 中 QObjectCleanupHandler 使用总结
Yixin Huachen: real estate enterprises want to grasp the opportunity of the times for digital transformation
SqlTransaction
1 goal, 3 fields, 6 factors and 9 links of digital transformation
Summary of the use of qobjectcleanuphandler in QT
百度时间因子添加
Michael Wooldridge, professeur à l'Université d'Oxford: comment la communauté de l'IA voit les réseaux neuronaux depuis près de 40 ans
被315点名的流氓下载器,又回来了…