SQL/SQL 문제
[HackerRank] Weather Observation Station 12
Lim Seung Hyun
2021. 11. 21. 16:12
문제 : https://www.hackerrank.com/challenges/weather-observation-station-12/problem?isFullScreen=true
Weather Observation Station 12 | HackerRank
Query an alphabetically ordered list of CITY names not starting and ending with vowels.
www.hackerrank.com
문제 해설
- STATION 테이블에서 모음(a,e,i,o,u)로 시작하지 않고 모음으로 끝나지 않는 CITY 이름을 조회
- 중복된 CITY 이름은 제외
나의 해설 (MySQL)
SELECT DISTINCT CITY
FROM STATION
WHERE CITY REGEXP("^[^aeiouAEIOU].+[^aeiouAEIOU]$");
728x90