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
(Utilise un article différent sur le même site que La réponse de Martin Wickman !)