此题为获取用户日期的最值问题
最近登录即日期最大值,根据用户id分组,并获取该用户的登录日期最大值即可,最后根据用户id升序
select user_id,max(date) from login
group by user_id
order by user_id asc