cs

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:

https://www.hackerrank.com/challenges/weather-observation-station-3/problem

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.

+ Recent posts