Mysql窗口函数解法
牛客每个人最近的登录日期(一)
http://www.nowcoder.com/questionTerminal/ca274ebe6eac40ab9c33ced3f2223bb2
select distinct
user_id,
last_value(date) over(partition by user_id order by date rows between current row and unbounded following) as d
from login; 