Select u.nome, u.cognome, a.id_utente, max(a.data_accesso) from utenti as u INNER JOIN accessi as a ON u.id = a.id group by a.id_utente;
oppure usa le tabelle temporanee.