with t2 as ( select l.*, if (l.date = t1.date, 1, null) as is_one from login as l left join ( select user_id, min(date) as date from login group by user_id ) as t1 on l.user_id = t1.user_id ) select date, ifnull ( round( ( select count(1) from login as l join t2 as t3 on l.user_id = t3.user_id and t...