Query all unique cities which id is even from the STATION table using SQL MOD() Function. This is the solution of HackerRank's Weather Observation Station 3 SQL problem.
Table name: STATION
Table Structure:
Fileds | Type |
ID | NUMBER |
CITY | VARCHAR |
STATE | VARCHAR |
LAT_N | NUMBER |
LONG_W | NUMBER |
SQL Query:
SELECT CITY FROM STATION
WHERE MOD(ID, 2) = 0
GROUP BY CITY;