Query the list of CITY names from STATION that do not start with vowels. 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.
MySql:
sol1:
select distinct city from station where left(city,1) not in ('a','e','i','o','u')
sol2:
SELECT DISTINCT CITY FROM STATION WHERE CITY REGEXP '^[^aeiou]';;
Oracle:
SELECT DISTINCT CITY FROM STATION WHERE NOT (CITY LIKE 'A%' OR CITY LIKE 'E%' OR CITY LIKE 'I%' OR CITY LIKE 'O%' OR CITY LIKE 'U%');
Expected Output
Post a Comment