Saturday 1 April 2017

Weather Observation Station 7

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.
Query:
MYSQL:
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';
MS SQL SERVER:

select  distinct city
from station
where right(city,1) in('a','e','i','o','u');

No comments:

Post a Comment