We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Weather Observation Station 5
Weather Observation Station 5
Sort by
recency
|
7261 Discussions
|
Please Login in order to post a comment
with base as ( select city, LENGTH(city) as size, row_number() over (partition by LENGTH(city) order by city) as row_id
from station where LENGTH(city) = (select max(LENGTH(city)) from station) or LENGTH(city) = (select min(LENGTH(city)) from station) order by LENGTH(city) desc, city asc ) select city,size from base where row_id=1
-- City with the shortest name SELECT TOP 1 CITY, LEN(CITY) AS NAME_LENGTH FROM STATION ORDER BY LEN(CITY), CITY;
-- City with the longest name SELECT TOP 1 CITY, LEN(CITY) AS NAME_LENGTH FROM STATION ORDER BY LEN(CITY) DESC, CITY;