even id numbers in a table called station

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sri lalitha
    New Member
    • Mar 2018
    • 1

    even id numbers in a table called station

    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.

    This Was My Solutino....
    Code:
    SELECT CITY FROM STATION WHERE MOD(ID,2) = 0;
    BUT ITS NOT WORKING
    Last edited by Frinavale; Mar 5 '18, 02:23 PM.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    The SQL 'distinct' statement is used to return only distinct (different) values. So if you have multiple records with the same CITY value, this will only return records that have different values (see the link for more details)

    Comment

    • Priyankacoder
      New Member
      • Feb 2022
      • 1

      #3
      distinct in sql

      A great resource to learn distinct in sql

      Comment

      Working...