I\'m trying to query the list of CITY names from STATION that do not start with vowels and do not end with vowels. The result cannot contain duplicates.
At first I tried
A little easier to read would be:
SELECT DISTINCT CITY FROM STATION WHERE SUBSTR(CITY,1,1) NOT IN ('A','E','I','O','U') AND SUBSTR(CITY,-1,1) NOT IN ('A','E','I','O','U');
Note the -1 in the second WHERE clause which tells Oracle to search from the end of the string.
-1
WHERE