Skip to content
Advertisement

sql query : show name with all vowels

Equatorial Guinea and Dominican Republic have all of the vowels (a, e, i, o, u) in the name. They don’t count because they have more than one word in the name.

You can use the phrase name NOT LIKE ‘%a%’ to exclude characters from your results. The query shown misses countries like Bahamas and Belarus because they contain at least one ‘a’

it does not work. the right answer is “Mozambique”

i hard coded it like “where name like ‘Moz’. It worked , but it’s cheating

Advertisement

Answer

Try using and name LIKE '%a%' for your vowels, this will search the entire string and not just the last letter.

For example:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement