You are viewing a single comment's thread. Return to all comments →
This works, but I thought for a moment that in the case where a result set includes cities with the same length the query might fail if you don't do
order by city
Say the result set looks like this:
Then wouldn't select distinct top 1 city,LEN(city) from station order by len(city)
select distinct top 1 city,LEN(city) from station order by len(city)
return Bb instead of Aa.
Seems like cookies are disabled on this browser, please enable them to open this website
Weather Observation Station 5
You are viewing a single comment's thread. Return to all comments →
This works, but I thought for a moment that in the case where a result set includes cities with the same length the query might fail if you don't do
order by city
Say the result set looks like this:
Then wouldn't
select distinct top 1 city,LEN(city) from station order by len(city)
return Bb instead of Aa.