We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Weather Observation Station 11
Weather Observation Station 11
Sort by
recency
|
3831 Discussions
|
Please Login in order to post a comment
SELECT DISTINCT CITY FROM STATION WHERE SUBSTRING(CITY, 1, 1) NOT IN ('A', 'E', 'I', 'O', 'U') AND SUBSTRING(CITY, LENGTH(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U');why this is not working
select distinct(CITY) FROM STATION
WHERE right(city,1) not IN ('a','e','i','o','u') or
left(city,1) not IN ('a','e','i','o','u')
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%') AND (CITY LIKE '%A' OR CITY LIKE '%E' OR CITY LIKE '%I' OR CITY LIKE '%O' OR CITY LIKE '%U'));
The task, asks for cities that either do not start with vowels 'OR' do not end with vowels. This is a logical "OR" condition, not "AND".
SELECT DISTINCT CITY FROM STATION WHERE LEFT(CITY, 1) NOT IN ('A', 'E', 'I', 'O', 'U') OR RIGHT(CITY, 1) NOT IN ('a', 'e', 'i', 'o', 'u');
SELECT DISTINCT city FROM station WHERE city REGEXP '^[^AEIOU]|.*[^AEIOU]$';