Query the list of CITY names from the STATION table that do not start with vowels and do not end with vowels. Your result cannot contain duplicates.
https://www.hackerrank.com/challenges/weather-observation-station-12/problem
Using the LIKE operator I came up with 3 queries as follows :
Working
SELECT DISTINCT CITY
FROM STATION
WHERE CITY NOT LIKE '[aeiou]%'
AND CITY NOT LIKE '%[aeiou]'
Working
SELECT DISTINCT CITY
FROM STATION
WHERE CITY LIKE '[^aeiou]%[^aeiou]';
Not working:
SELECT DISTINCT CITY
FROM STATION
WHERE CITY NOT LIKE '[aeiou]%[aeiou]';
Can someone tell me why this third query is not working?