[해커랭크/SQL] Weather Observation Station 3

canugo·2023년 3월 5일
0

해커랭크

목록 보기
8/12

문제

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:

문제해석 & 풀이

STATION테이블에서 CITY의 ID가 짝수인 것을 중복없이 선택해라

SELECT DISTINCT CITY FROM STATION WHERE ID%2=0 

SELECT DISTINCT CITY FROM STATION ➡ STATION 으로부터 CITY를 중복없이 선택해라
WHERE ID%2=0 ➡ ID가 짝수인 것을

0개의 댓글