每日访问记录为表格 user_visit_log,用户id已去重,请输出每位用户最大连续访问天数。
区块链毕设网qklbishe.com为您提供问题的解答
每日访问记录为表格 user_visit_log,用户id已去重,请输出每位用户最大连续访问天数。
select id, max(diff计数)as max_Continuous_login_days
from
(
select id, count(diff)as diff计数
from(
select *, (julianday(datetime(‘now’))-julianday(visit_date)) – row_number() over(partition by id order by visit_date desc) as diff
from user_visit_log
)as t1
group by id, diff
)
group by id
from
(
select id, count(diff)as diff计数
from(
select *, (julianday(datetime(‘now’))-julianday(visit_date)) – row_number() over(partition by id order by visit_date desc) as diff
from user_visit_log
)as t1
group by id, diff
)
group by id
24:57
以上就是关于问题每日访问记录为表格 user_visit_log,用户id已去重,请输出每位用户最大连续访问天数。的答案
欢迎关注区块链毕设网-
专业区块链毕业设计成品源码,定制。
区块链NFT链游项目方科学家脚本开发培训