When trying to resolve a platform bank issue hackerrank I could not understand the answer after having found it in the discussion wing.
The question says:
Query a list of CITY names from STATION with even ID numbers only. You may print the results in any order, but you must exclude duplicates from your answer.
Make a query for the names of cities in the STATION table with only ID numbers. You can show the result in any order, but exclude duplicate responses.
Description of the STATION table
The answer marked as certain would be
SELECT DISTINCT city FROM station WHERE (id % 2) = 0;
My question is about WHERE (id % 2 ) = 0
, I did not understand the answer, at first only DISTINCT
solves the question, can anyone explain?
Is there another way to do it in MySQL?