- Weather Observation Station 6

 Query the list of CITY names starting with vowels (i.e., a, e, i, o, or 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 1:

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 city like 'a%' or city like 'e%' or city like 'i%' or city like 'o%' or city like 'u%';


solution 2:

SELECT DISTINCT city FROM station WHERE city REGEXP "^[aeiou].*";

Expected Output
  • Acme 
  • Addison 
  • Agency 
  • Aguanga 
  • Alanson 
  • Alba 
  • Albany 
  • Albion 
  • Algonac 
  • Aliso Viejo 
  • Allerton 
  • Alpine 
  • Alton 
  • Amazonia 
  • Amo 
  • Andersonville 
  • Andover 
  • Anthony 
  • Archie 
  • Arispe {-truncated-}


Post a Comment

Previous Post Next Post