美文网首页
Leetcode 1097. 游戏玩法分析 V

Leetcode 1097. 游戏玩法分析 V

作者: 七齐起器 | 来源:发表于2021-11-26 00:06 被阅读0次

https://leetcode-cn.com/problems/game-play-analysis-v/

1097.png
select
c.min_date install_dt 
,c.installs installs
,if(c.retention=0,0.00,round(c.retention/c.installs,2))Day1_retention 
from(
    select 
    a.min_date
    ,count(a.player_id) installs 
    ,sum(case when b.event_date is not null then 1 else 0 end)retention
    from(
        select player_id,min(event_date) min_date from Activity group by player_id
    )a left join Activity b on (DATE_ADD(a.min_date,INTERVAL 1 DAY)=b.event_date and a.player_id=b.player_id)
    group by a.min_date
    order by a.min_date
)c 

相关文章

网友评论

      本文标题:Leetcode 1097. 游戏玩法分析 V

      本文链接:https://www.haomeiwen.com/subject/ueyztrtx.html