Ovviamente le date devono essere tali. Nel tuo esempio nel formato gg-mm-aaaa sono stringhe e l'ordinamento avverrà di conseguenza.codice:set @ufficio := '', @num := 1; select * from ( select *, @num := if(@ufficio = ufficio, @num + 1, 1) as riga_numero, @ufficio := ufficio as uff from tabella order by ufficio asc, data desc) as tab where riga_numero <= 2;