select *
from table
where LENGTH(name) - LENGTH(REPLACE(name, 'a', '')) between 1 and 2
Actualizado para usar entre.
select *
from table
where LENGTH(name) - LENGTH(REPLACE(name, 'a', '')) between 1 and 2
Actualizado para usar entre.