알고리즘/HackerRank
[HackerRank] Weather Observation Station 8 오라클 풀이
mndev
2024. 1. 29. 10:26
문제링크
Weather Observation Station 8 | HackerRank
Query CITY names that start AND end with vowels.
www.hackerrank.com
풀이
도시 이름이 모음으로 시작하지 않고, 모음으로 끝나지 않는 문제의 조건에 따라
like함수를 사용해 풀이하면 된다.
코드
select distinct city
from station
where (upper(city) like 'A%'
or upper(city) like 'E%'
or upper(city) like 'I%'
or upper(city) like 'O%'
or upper(city) like 'U%')
and
(upper(city) like '%A'
or upper(city) like '%E'
or upper(city) like '%I'
or upper(city) like '%O'
or upper(city) like '%U');