순간을 기록으로

[MySQL] Weather Observation Station 11 | 정규표현식 본문

Problem Solving

[MySQL] Weather Observation Station 11 | 정규표현식

luminous13 2022. 3. 29. 12:06

문제

- 도시명이 모음으로 시작하지 않거나 모음으로 끝나지 않는 도시 리스트를 조회하세요.

- 결과에 중복이 있으면 안됩니다.

풀이

select distinct city
from station
where city regexp '^[^aeiou]'
or
city regexp '[^aeiou]$';

 


출처: https://www.hackerrank.com/challenges/weather-observation-station-11/problem?isFullScreen=true&h_r=next-challenge&h_v=zen&h_r=next-challenge&h_v=zen 

 

Weather Observation Station 11 | HackerRank

Query a list of CITY names not starting or ending with vowels.

www.hackerrank.com

 

Comments