Weather Observation Station 5

  • + 0 comments
    with RankedCities as (
        select
            city,
            length(city) as name_length,
            Row_number() over (order by length(city) asc, city asc) as shortest_length,
            Row_number() over (order by length(city) desc, city desc) as longest_length
        from
        station
    )
    select city,name_length
    from RankedCities 
    where shortest_length = 1 OR longest_length = 1