HackerRank-My SQL
Prepare >SQL > Basic Select > Weather Observation Station 3
stem_sw
2023. 7. 6. 19:15
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.
=> ID가 짝수인 CITY이름을 쿼리하라. 중복은 배제.
코드
SELECT DISTINCT(CITY) FROM STATION
WHERE ID%2 = 0;