Weather Observation Station 5

  • + 0 comments

    MS SQL Server: I think below code is easy to understand and works well in MS SQL Server:

    WITH shortest as ( select top 1 city, len(city) as small_city from station order by len(city),city ), largest as ( select top 1 city, len(city) as big_city from station order by len(city) desc,city asc ) select city, small_city from shortest union all select city, big_city from largest;