You are viewing a single comment's thread. Return to all comments →
select top 1 city,len(city) as shortest from station order by len(city),city
select top 1 city,len(city) as longest from station order by len(city) desc, city
You dont have to "city desc" the second query because they want to display the city alphabetically.
He ordered DESC in the second query to get the maximum length. By ordering it ASC in the forst query, he got the city with the minimum length.