You can do this using not exists
, by choosing rows where there is no larger date for a given name
:
select ps.*
from ps
where not exists (select 1
from ps ps2
where ps2.name = ps.name and
ps2.userid = 63 and
ps2.date > ps.date
) and
ps.userid = 63;
This will work best with an index on ps(name, userid, date)
.