By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
SELECT city
FROM (
SELECT 'xx' AS city UNION
SELECT 'ax' UNION
SELECT 'xa' UNION
SELECT 'aa' UNION
SELECT 'x' UNION
SELECT 'a'
) AS station
WHERE NOT city REGEXP '^[^aeiou]|[^aeiou]$'
city |
---|
aa |
a |