Lim Seunghyun Space

[HackerRank] Weather Observation Station 3 본문

SQL/SQL 문제

[HackerRank] Weather Observation Station 3

Lim Seung Hyun 2021. 11. 19. 10:30

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

 

Weather Observation Station 3 | HackerRank

Query a list of unique CITY names with even ID numbers.

www.hackerrank.com

 

문제 해설

  • STATION 테이블에서 ID 번호가 짝수인 NAME을 조회
  • 결과값에서 중복인 데이터는 제외

 

풀이 (MySQL)

SELECT DISTINCT CITY
FROM STATION
WHERE ID % 2 = 0;
728x90