Example Words: a, akkka, akokaa, kokoko, kakao, oooaooa, kkako, kakaoa
I need the regexp witch gives words with 2 or less \'a\' but not the words without \'a\'
select * from table where LENGTH(name) - LENGTH(REPLACE(name, 'a', '')) between 1 and 2
Updated to use between.