'I have to search for all city name starting with vowel words but array pattern is not working for MySQL

Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates.

select distinct(city)
from station 
where city like "%A" or city like "%E" or city like "%I" or city like "%O" or city like "%U"

The above code is working properly. But I don't know why below code is not working

select distinct(city)
from station 
where city like "%[AEIOU]"

I tried REGEXP_LIKE as well but not getting error. I am using MySQL



Solution 1:[1]

SELECT city FROM table_name WHERE substr(city,1,1) in('a','e','i','o','u');

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 xerx593