We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Then, you have to change the ASC and DESC in order by statement,
SELECT CITY, LENGTH(CITY) FROM STATION WHERE ID = (SELECT ID FROM STATION ORDER BY LENGTH(CITY) ASC ,CITY DESC LIMIT 0,1);
* This will first sort the result by the length of the city, if the length of multiple rows are same then it will sort them in descending order of city name*\
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Weather Observation Station 5
You are viewing a single comment's thread. Return to all comments →
Then, you have to change the ASC and DESC in order by statement,
SELECT CITY, LENGTH(CITY) FROM STATION WHERE ID = (SELECT ID FROM STATION ORDER BY LENGTH(CITY) ASC ,CITY DESC LIMIT 0,1); * This will first sort the result by the length of the city, if the length of multiple rows are same then it will sort them in descending order of city name*\