select
    distinct user_id,
    max(date)over(partition by user_id order by date desc)
from
    login