34,871
社区成员




想做的是这个题目,目前的主要疑问是这样count相除是不允许的吗,还是说我用法不对
SELECT COUNT(DISTINCT player_id) * 1.0 /
(SELECT COUNT(DISTINCT player_id) FROM activity)
FROM (SELECT player_id,
event_date,
LEAD(event_date) OVER(PARTITION BY player_id ORDER BY event_date) AS next_day
FROM activity) t
WHERE next_day - event_date = 1;