select id, title, type
from (select id, title, type,
@num := if(@group = type, @num + 1, 1) as row_number,
@group := type as dummy
from your_table
order by type, title) as x
where row_number <= 3
(Utilizza un articolo diverso sullo stesso sito di La risposta di Martin Wickman !)