나홀로공부/Oracle

HackerRank - Weather Observation Station 6

mikan- 2023. 5. 6. 22:34

Question - Weather Observation Station 6

 

Query the list of CITY names starting with vowels (i.e., a, e, i, o, or 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.

 

번역

 

STATION에서 모음으로 시작하는 CITY 이름 목록(예: a, e, i, o 또는 u)을 쿼리합니다. 결과에 중복 항목을 포함할 수 없습니다.
입력 형식
STATION 테이블은 다음과 같이 설명됩니다:
여기서 LAT_N은 북위도이고 LONG_W는 서경도입니다.

 

 

정답

 

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%');