https://www.hackerrank.com/challenges/weather-observation-station-3/problem
Weather Observation Station 3 | HackerRank
Query a list of unique CITY names with even ID numbers.
www.hackerrank.com
문제
Query a list of CITY names from STATION for cities that have an even ID number. Print the results in any order, but exclude duplicates from the answer.
The STATION table is described as follows:

where LAT_N is the northern latitude and LONG_W is the western longitude.
생각해보기
ID가 짝수
순서는 아무렇게나
DISTINCT를 이용하여 중복 제거
코드
더보기
SELECT DISTINCT(CITY)
FROM STATION
WHERE ID % 2 = 0;
728x90
'서버 > MYSQL' 카테고리의 다른 글
| [MYSQL] HACKERRANK - Weather Observation Station 5 (0) | 2022.06.06 |
|---|---|
| [MYSQL] HACKERRANK - Weather Observation Station 4 (0) | 2022.06.03 |
| [MYSQL] HACKERRANK - Weather Observation Station 1 (0) | 2022.06.01 |
| [MYSQL] HACKERRANK - Japanese Cities' Names (0) | 2022.05.31 |
| [MYSQL] HACKERRANK - Japanese Cities' Attributes (0) | 2022.05.31 |
댓글