当前位置:网站首页>找出连续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);
边栏推荐
- ONEFLOW source code parsing: automatic inference of operator signature
- 微信小程序接入百度统计报错 Cannot read property ‘mtj‘ of undefined
- 几行代码就能实现复杂的 Excel 导入导出,这个工具类真心强大!
- leetcode 1689. Partitioning into minimum number of deci binary numbers
- Professor Michael Wooldridge of Oxford University: how the AI community views neural networks in the past 40 years
- CVPR2022 | 浙大、蚂蚁集团提出基于标签关系树的层级残差多粒度分类网络,建模多粒度标签间的层级知识
- [unity3d] camera follow
- Win 10创建一个gin框架的项目
- 618 activity season - the arrival of special discounts for hundreds of low code platforms
- 内存泄露
猜你喜欢

Steam education to break the barriers between disciplines

First day of new work

牛津大学教授Michael Wooldridge:AI社区近40年如何看待神经网络

Anonymous function variable problem

Opengauss kernel: analysis of SQL parsing process

牛津大學教授Michael Wooldridge:AI社區近40年如何看待神經網絡

About Critical Values

双功能交联剂丨Lumiprobe 磺基花青7二羧酸研究

Anonymous function this pointing and variable promotion

C# 41. Int to string
随机推荐
几行代码就能实现复杂的 Excel 导入导出,这个工具类真心强大!
Mybayis之核心主件分析
技术管理进阶——管理者如何做绩效沟通及把控风险
【Unity3D】相机跟随
About Significance Tests
async-validator.js数据校验器
福建的朋友们,你们的养老保险上云啦!
基于管线的混合渲染
Opengauss kernel: analysis of SQL parsing process
Advanced technology management - how managers communicate performance and control risks
leetcode 1647. Minimum Deletions to Make Character Frequencies Unique(所有字母频率不同的最小删除次数)
About Covariance and Correlation(协方差和相关)
抗兔Dylight 488丨Abbkine通用型免疫荧光(IF)工具箱
用户网络模型与QoE
内存泄露
POI excel conversion tool
正版ST-link/V2 J-LINK JTAG/SWD引脚定义和注意事项
Tensorboard Usage Summary
render函数解析
Memory leak