https://www.hackerrank.com/challenges/weather-observation-station-9/problem
select DISTINCT CITY
from STATION
where city not like 'a%'
and city not like 'e%'
and city not like 'i%'
and city not like 'o%'
and city not like 'u%'
SELECT DISTINCT CITY FROM STATION WHERE CITY REGEXP '^[^aeiou]';
정규 표현 식
'^..$'; // 시작부터 2글자로 끝나는 이름을 찾아라.
'^I'; // 첫글자가 I로 시작되는 문장을 찾아라
^ : 문자열의 처음 -> ^1 -> 1로 시작되는 줄
'Algorithm > SQL' 카테고리의 다른 글
[SQL][HackerRank] Weather Observation Station 11 (0) | 2020.06.09 |
---|---|
[SQL][HackerRank] Weather Observation Station 10 (0) | 2020.06.09 |
[SQL][HackerRank] Weather Observation Station 8 (0) | 2020.06.08 |
[SQL][HackerRank] Weather Observation Station 6 (0) | 2020.06.08 |
[SQL][HackerRank] Weather Observation Station 5 (0) | 2020.06.08 |