새소식

IT/SQL

[해커랭크] Weather Observation Station 3

  • -
728x90
반응형

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

 

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

SELECT DISTINCT CITY
FROM STATION
WHERE MOD(ID, 2) = 0;

DISTINCT

  • 중복제거
  • groupby에 비해 성능이 빠름

MOD(m,n) : m을 n으로 나눈 나머지를 반환

 

 
728x90
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.