Practice > SQL > Basic Select > Weather Observation Station 7

첫번째 정규표현식 문제입니다.

Problem

Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates.
문제링크

Answer

SELECT distinct city -- duplicate를 없애기 위해 distinct
FROM station
WHERE city REGEXP '.*[aeiou]$' -- ^은 시작, $은 끝, *은 어떤 것이 와도 괜찮다는 의미, .은 match any character

0개의 댓글