select round(count(distinct user_id)*1.0/(select count(distinct user_id) from login) ,3) from login where (user_id,date) in (select user_id,DATE_ADD(min(date),INTERVAL 1 DAY) from login group by user_id); 1、找到每个用户第一天登录的日期和次日也登录的记录 where (user_id,date) in ( select user_id, DATE_ADD(min(date),IN...