Weather Observation Station 5

  • + 1 comment

    Annoyingly enough the "equivalent"

    SELECT CITY, CHAR_LENGTH(CITY) FROM STATION ORDER BY 2 LIMIT 1;
    SELECT CITY, CHAR_LENGTH(CITY) FROM STATION ORDER BY 2 DESC LIMIT 1;
    

    Doesn't work correctly since there's multiple entries having the same value for the shortest string. In a production setting you'd probably want to extend this answer to include a more complex order by.