728x90
문제
Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION.
Your result cannot contain duplicates.
Input Format
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the western longitude.
https://www.hackerrank.com/challenges/weather-observation-station-7/problem?isFullScreen=true
문제 풀이
SELECT DISTINCT city
FROM station
WHERE city REGEXP '.*[aeiou]$'
SELECT DISTINCT city
FROM station
WHERE city Like '%a'
OR city Like '%e'
OR city Like '%i'
OR city Like '%o'
OR city Like '%u'
SQL을 독학하시는 분들에게 도움이 되길 바라며,
혹 더 좋은 방법이 있거나 오류가 있다면 편하게 말씀 부탁드립니다.
728x90