Reputation: 319
Query the list of CITY names from STATION which have vowels as both their first and last characters. Your result cannot contain duplicates. Station consists of a column called city.
Query:
SELECT CITY FROM STATION WHERE CITY LIKE '[AEIOU]%[AEIOU]';
How is this wrong? It produces no output.
Upvotes: 4
Views: 572
Reputation: 1856
You have to use REGEXP.
Your code should be like
SELECT CITY FROM STATION WHERE CITY REGEXP '^[AEIOU].*[AEIOU]$';
Upvotes: 3