Tuesday, October 17, 2017

Weather Observation Station 3

Problem:
Query a list of CITY names from STATION with even ID numbers only. You may print the results in any order, but must exclude duplicates from your answer.
Input Format
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the western longitude.



--The SQL DISTINCT command along with the SQL MOD() function is used to retrieve only unique records depending on the specified column or expression.
SELECT DISTINCT City FROM Station WHERE MOD(ID,2)=0

No comments:

Post a Comment