Weather Observation Station 5
Weather Observation Station 5
+ 0 comments (select city, length(city) from station order by length(city),city limit 1) union (select city, length(city) from station order by length(city) desc, city limit 1)
+ 0 comments SELECT sub.CITY, sub.leng FROM ( SELECT CITY, LENGTH(CITY) AS leng, ROW_NUMBER() OVER (ORDER BY LENGTH(CITY) ASC, CITY ASC) AS first_row, ROW_NUMBER() OVER (ORDER BY LENGTH(CITY) DESC, CITY ASC) AS last_row FROM STATION ) sub WHERE sub.first_row=1. OR sub.last_row=1
+ 0 comments WITH RankedCities AS ( SELECT CITY, LENGTH(CITY) AS LEN, RANK() OVER (ORDER BY LENGTH(CITY), CITY) AS ShortestRank, RANK() OVER (ORDER BY LENGTH(CITY) DESC, CITY) AS LongestRank FROM STATION ) SELECT CITY, LEN FROM RankedCities WHERE ShortestRank = 1 OR LongestRank = 1;
+ 0 comments SELECT CITY, LENGTH(CITY) AS LEN FROM STATION ORDER BY LEN,CITY LIMIT 1; SELECT CITY, LENGTH(CITY) AS LEN FROM STATION ORDER BY LEN DESC, CITY LIMIT 1;
+ 1 comment SELECT city, LENGTH(city) AS city_length FROM station ORDER BY city_length, city LIMIT 1; -- Shortest city SELECT city, LENGTH(city) AS city_length FROM station ORDER BY city_length DESC, city LIMIT 1; -- Longest city
Sort 5660 Discussions, By:
Please Login in order to post a comment