with cte (rank, city , CityLength)
As
(select dense_rank() over (partition by len(city) order by city asc) as Rank, city, len(city)
from station
where len(city) in
((select max(len(city)) from station)
union (select min(len(city)) from station)))
select city,citylength from cte where rank = 1;