Prepare > SQL > Basic Select > Weather Observation Station 10

2023. 7. 13. 19:17HackerRank-My SQL

 

Weather Observation Station 10 | HackerRank

Query a list of CITY names not ending in vowels.

www.hackerrank.com

 

문제


Query the list of CITY names from STATION that do not end with vowels. Your result cannot contain duplicates.

 

 

 

 

코드


SELECT DISTINCT(CITY) FROM STATION
WHERE RIGHT(CITY, 1) REGEXP "[^AEIOU]";
SELECT DISTINCT(CITY) FROM STATION
WHERE CITY REGEXP "[^AEIOU]$";