Lim Seunghyun Space

[HackerRank] Weather Observation Station 10 본문

SQL/SQL 문제

[HackerRank] Weather Observation Station 10

Lim Seung Hyun 2021. 11. 21. 14:12

문제 : https://www.hackerrank.com/challenges/weather-observation-station-10/

 

Weather Observation Station 10 | HackerRank

Query a list of CITY names not ending in vowels.

www.hackerrank.com

 

문제 해설

  • STATION 테이블에서 모음(a,e,i,o,u)로 끝나지 않는 CITY의 이름을 조회
  • 중복된 CITY는 제외

 

나의 풀이 (MySQL)

SELECT DISTINCT CITY
FROM STATION
WHERE CITY REGEXP("^.+[^aeiouAEIOU]$");
728x90