Recent Posts
Recent Comments
Link
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Archives
Today
Total
관리 메뉴

Studying data

[HackerRank] Basic Select > Weather Observation Station 11 본문

SQL

[HackerRank] Basic Select > Weather Observation Station 11

halloweenie 2022. 12. 27. 18:32

Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. 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.

 

[MySQL Solution]

SELECT DISTINCT CITY 
FROM STATION
WHERE CITY REGEXP '^[^aeiou]|[^aeiou]$';  -- REGEXP 대신 RLIKE도 가능

 

문제 링크:

https://www.hackerrank.com/challenges/weather-observation-station-11/problem?isFullScreen=true 

Comments