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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--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