select
u.name, c.name, t1.mdate
from (
select l.user_id, l.client_id, t.mdate
from login l inner join (
select
user_id,
max(date) as mdate
from login
group by user_id
) t on t.mdate=l.date and t.user_id=l.user_id
) t1
join user u on u.id=t1.user_id
join client c on c.id=t1.client_id
order by u.name;