网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

mysql中怎么统计留存率

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

创新互联公司云计算的互联网服务提供商,拥有超过13年的服务器租用、雅安电信机房、云服务器、虚拟主机、网站系统开发经验,已先后获得国家工业和信息化部颁发的互联网数据中心业务许可证。专业提供云主机、虚拟主机、域名与空间、VPS主机、云服务器、香港云服务器、免备案服务器等。

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 createTimeupdate 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 createTimeupdate 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 createTimeupdate 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 createTimeupdate 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 createTimeupdate 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 createTimeupdate 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 createTimeupdate 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 createTimeend if;
SET i=i+1;
end while;
SET numareaId=numareaId-1;
SET currentareaId=currentareaId+1;
END WHILE loop1;
end

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


新闻标题:mysql中怎么统计留存率
当前地址:http://bjjierui.cn/article/piipgc.html

其他资讯