prova così:
Codice PHP:
select usernameipmax(datafrom tabella group by username order by username
ciao