title: Query to find the city name with longest and shortest length
body: <p>I've written a query to return me the cities with the shortest and longest length strings in a MS SQL SERVER database.</p>
  
  <pre><code>Select city, len(city) as l 
  From Station Where len(city) in 
  ((select max(len(city)) from station)
  Union
  (select min(len(city)) from station)) 
  Order by l,city;
  </code></pre>
  
  <p>My difficulty is that I get duplicates, because I have a few cities that have the longest and shortest length. Also when I try to <code>ORDER BY CITY</code> in both sub queries it fails.</p>
  
  <p>Any advice?</p>