코딩코딩코딩

[HackerRank] Weather Observation Station 9 본문

MySQL/Problem Solving

[HackerRank] Weather Observation Station 9

hanshow113 2022. 1. 9. 20:48

-- NOT LIKE 연산자 사용
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%";

-- REGEXP 사용
SELECT DISTINCT(CITY)
FROM STATION
WHERE CITY NOT REGEXP "^[aeiou]";
Comments