문제풀이/HackerRank

weather observation station 6

제밍 2022. 11. 2. 15:45

이 문제 덕분에 REGEXP를 알게 된,,, 

첨엔 좀 헷갈렸는데 어느정도 숙지하니까 

타이핑도 길게 안써도 되고 편함 

 

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.

< 구분할것! >

ORACLE식 답 : 

SELECT DISTINCT CITY 
FROM STATION
WHERE REGEXP_LIKE(CITY,'^A|^E|^I|^O|^U') ;

 

MYSQL식 답 :

SELECT DISTINCT CITY 
FROM STATION
WHERE CITY REGEXP '^[AEIOU]' ;

 

 

Weather Observation Station 6 | HackerRank

 

Weather Observation Station 6 | HackerRank

Query a list of CITY names beginning with vowels (a, e, i, o, u).

www.hackerrank.com