select u.name u_n,c.name c_n,t.maxdate date
from (select user_id,max(date) maxdate
    from login 
    group by user_id) t
join (select user_id,client_id,date from login) n 
on t.maxdate = n.date and t.user_id = n.user_id
join user u 
on t.user_id = u.id
join client c 
on n.client_id = c.id
order by u_n asc;

好复杂....