Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION

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

Input Format

The STATION table is described as follows:

where LAT_N is the northern latitude and LONG_W is the western longitude.

———-SOLUTION———-

 

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';

 

OR

SELECT DISTINCT CITY FROM STATION WHERE SUBSTRING(REVERSE(CITY),1,1) in('A','E','I','O','U');

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *