https://www.hackerrank.com/challenges/weather-observation-station-12/problem?isFullScreen=true
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%'
AND city NOT LIKE '%a'
AND city NOT LIKE '%e'
AND city NOT LIKE '%i'
AND city NOT LIKE '%o'
AND city NOT LIKE '%u'
복붙 없이 코드를 짜려면 정규표현식을 사용해야 함
정규표현식 (regular expression -> REGEXP)
문자열에서 특정 패턴을 찾아내는데 쓰이는 식
SELECT DISTINCT city
FROM station
WHERE city REGEXP '^[aeiou].*'
^ 는 시작
.*는 와일드카드(%)와 동일
'SQL' 카테고리의 다른 글
HackerRank_SQL_Type of Triangle <못품> (0) | 2023.01.11 |
---|---|
HackerRank_SQL_Top Eearners (0) | 2023.01.11 |
HackerRank_SQL_Weather Observation Station 15, 소숫점 (0) | 2023.01.05 |
HackerRank_SQL_Higher Tan 75 Marks, 문자열 자르기 (0) | 2023.01.05 |
HackerRank_SQL_Weather Observation Station 6 (0) | 2023.01.05 |