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.
[My Answer]
select DISTINCT city from station
where ID %2 = 0
ORDER BY CITY ASC
It was a little bit tiresome for me cuz the even number.. I never used an even number query before.
Now, I got it.
'Code Problems > SQL_ HackerRank' 카테고리의 다른 글
[Hacker Rank] Weather Observation Station 5 (0) | 2021.04.17 |
---|---|
[HackerRank] Weather Observation Station 4 (0) | 2021.04.11 |
[HackerRanker] Weather Observation Station 1 (0) | 2021.04.08 |
[HackerRank]Japanese Cities' Names (0) | 2021.04.08 |
[HackerRank]Select By ID (0) | 2021.04.08 |