SQL/HACKER_RANK
[EASY] Weather Observation Station 7
소금깨
2022. 10. 26. 03:13
Weather Observation Station 7 | HackerRank
Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION.
www.hackerrank.com
문제 조건
끝 글자가 a,e,i,o,u를 가지는 city 이름을 유니크하게 출력하시오
문제 풀이
# solution 1
select distinct city
from station
where city regexp '[a,e,i,o,u]$'
# solution 2
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'