Prepare > SQL > Basic Select > Weather Observation Station 12

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

 

Weather Observation Station 12 | HackerRank

Query an alphabetically ordered list of CITY names not starting and ending with vowels.

www.hackerrank.com

 

문제


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

 

 

 

 

코드


SELECT DISTINCT(CITY) FROM STATION
WHERE LEFT(CITY, 1) REGEXP "[^AEIOU]"
    AND RIGHT(CITY, 1) REGEXP "[^AEIOU]";
SELECT DISTINCT(CITY) FROM STATION
WHERE CITY REGEXP '^[^AEIOU].*[^AEIOU]$';

 

 

 

 

참조


 

Prepare > SQL > Basic Select > Weather Observation Station 11

Weather Observation Station 11 | HackerRank Query a list of CITY names not starting or ending with vowels. www.hackerrank.com 문제 Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. Your result canno

my-little-diary.tistory.com