千家信息网

mysql中怎么统计留存率

发表于:2025-11-07 作者:千家信息网编辑
千家信息网最后更新 2025年11月07日,这期内容当中小编将会给大家带来有关mysql中怎么统计留存率,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。Sql代码begindeclare i int;decla
千家信息网最后更新 2025年11月07日mysql中怎么统计留存率

这期内容当中小编将会给大家带来有关mysql中怎么统计留存率,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。

Sql代码
  begin
  declare i int;
  declare numareaId int(10);
  declare currentareaId int(10);
  SELECT COUNT(areaId),MIN(areaId) INTO @a,@b FROM option_area_info;
  SET numareaId=@a;
  SET currentareaId=@b;
  loop1:WHILE numareaId>0 DO
  SET @AID = currentareaId;
  SET i=1;
  while i<8 do
  if exists(select * from statistics_player_l where createTime>=date_sub(curdate(),interval i day) and createTime  update statistics_player_l set oneDayPlayer=(select ((select count(distinct playerId) from log_login where registerTime=date_sub(curdate(),interval i day) and loginTime>=date_add(date_sub(curdate(),interval i day),interval 1 day) and loginTime=date_sub(curdate(),interval i day) and createTime  update statistics_player_l set twoDayPlayer=(select ((select count(distinct playerId) from log_login where registerTime=date_sub(curdate(),interval i day) and loginTime>=date_add(date_sub(curdate(),interval i day),interval 2 day) and loginTime=date_sub(curdate(),interval i day) and createTime  update statistics_player_l set threeDayPlayer=(select ((select count(distinct playerId) from log_login where registerTime=date_sub(curdate(),interval i day) and loginTime>=date_add(date_sub(curdate(),interval i day),interval 3 day) and loginTime=date_sub(curdate(),interval i day) and createTime  update statistics_player_l set fourDayPlayer=(select ((select count(distinct playerId) from log_login where registerTime=date_sub(curdate(),interval i day) and loginTime>=date_add(date_sub(curdate(),interval i day),interval 4 day) and loginTime=date_sub(curdate(),interval i day) and createTime  update statistics_player_l set fiveDayPlayer=(select ((select count(distinct playerId) from log_login where registerTime=date_sub(curdate(),interval i day) and loginTime>=date_add(date_sub(curdate(),interval i day),interval 5 day) and loginTime=date_sub(curdate(),interval i day) and createTime  update statistics_player_l set sixDayPlayer=(select ((select count(distinct playerId) from log_login where registerTime=date_sub(curdate(),interval i day) and loginTime>=date_add(date_sub(curdate(),interval i day),interval 6 day) and loginTime=date_sub(curdate(),interval i day) and createTime  update statistics_player_l set sevenDayPlayer=(select ((select count(distinct playerId) from log_login where registerTime=date_sub(curdate(),interval i day) and loginTime>=date_add(date_sub(curdate(),interval i day),interval 7 day) and loginTime=date_sub(curdate(),interval i day) and createTime  end if;
  SET i=i+1;
  end while;
  SET numareaId=numareaId-1;
  SET currentareaId=currentareaId+1;
  END WHILE loop1;
  end

上述就是小编为大家分享的mysql中怎么统计留存率了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注行业资讯频道。

统计 内容 分析 专业 中小 代码 内容丰富 就是 文章 更多 知识 篇文章 行业 角度 资讯 资讯频道 频道 有关 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 网络安全手抄报怎么画五年级 美团软件开发实习招聘流程 软件开发公司的资质包括哪些 银行业国家网络安全周汇报材料 ug多种刀具数据库建立 银行数据库高可用 无线路由服务器无响应 网络技术专业人员匮乏 榆次展厅大屏导航软件开发公司 宁波海曙区商用软件开发 软件开发工程师 职业规划 悬镜安全卫士添加服务器 卫士通是网络安全联盟成员 广州哲彦互联网科技有限公司 limit在数据库中 软件开发招标文件编制说明 开发设立官网与服务器 开展网络安全保密教育简报 服务器出现404页面怎么办 查看linux服务器密码 手机app软件开发怎样收费 公司的网络安全进行管理 软件开发常见模式 文化遗产数据库的用户比重 寄云科技互联网平台 关系数据库中链接的类型 工程类计算机网络技术 赛季服鱼人服务器金币价格 网络安全高级技师资格证报考条件 服务器出现404页面怎么办
0