求每天(若有)的 new install数 以及 次日留存率
select install_date,
count(player_id)as installs ,
count(event_date)/count(player_id) as Day1_retention
from
(select T1.player_id,
T1.install_date,
T2.event_date
from (select player_id,
min(event_date) as install_date
from activity
group by player_id) T1
left join activity T2
on T1.player_id=T2.player_id
and T1.install_date+1=T2.event_date)A
group by install_date ;