31 January 2018

Weather Observation Station 5

My solution:
(SELECT CITY, 
        LENGTH(CITY) 
 FROM   STATION 
 GROUP  BY CITY 
 HAVING LENGTH(CITY) <= (SELECT MIN(LENGTH(CITY)) 
                         FROM   STATION) 
 LIMIT  1) 
UNION 
(SELECT CITY, 
        LENGTH(CITY) 
 FROM   STATION 
 GROUP  BY CITY 
 HAVING LENGTH(CITY) >= (SELECT MAX(LENGTH(CITY)) 
                         FROM   STATION) 
 LIMIT  1);