Prepare > SQL > Basic Select > Weather Observation Station 12
2023. 7. 13. 19:29ㆍHackerRank-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
'HackerRank-My SQL' 카테고리의 다른 글
Prepare > SQL > Basic Select > Employee Salaries (0) | 2023.07.14 |
---|---|
Prepare > SQL > Basic Select > Employee Names (0) | 2023.07.14 |
Prepare > SQL > Basic Select > Weather Observation Station 11 (0) | 2023.07.13 |
Prepare > SQL > Basic Select > Weather Observation Station 10 (0) | 2023.07.13 |
Prepare > SQL > Basic Select > Weather Observation Station 9 (0) | 2023.07.12 |