Weather Observation Station 5

Sort by

recency

|

6782 Discussions

|

  • + 0 comments

    **SQL ORACLE **someone could find my mistake?

    SELECT CITY FROM (SELECT CITY FROM STATION ORDER BY CITY) WHERE LENGTH(CITY)=(SELECT MAX(LENGTH(CITY)) FROM STATION) AND ROWNUM <= 1;

    SELECT CITY FROM (SELECT CITY FROM STATION ORDER BY CITY) WHERE LENGTH(CITY)=(SELECT MIN(LENGTH(CITY)) FROM STATION) AND ROWNUM <= 1;

  • + 0 comments

    with CityLengths as ( Select City, Length(City) as City_Length from Station ), ShortestCity as ( Select City, City_Length from CityLengths where City_Length = (Select Min(Length(City)) from CityLengths) order by City asc Limit 1 ), LongestCity as( Select City, City_Length from CityLengths where City_Length = (Select Max(Length(City)) from CityLengths) order by City asc Limit 1 ) Select City, City_Length from ShortestCity Union All Select City, City_Length from LongestCity

  • + 0 comments

    (SELECT CITY, LENGTH(CITY) AS len FROM STATION ORDER BY len DESC, CITY ASC LIMIT 1) UNION ALL (SELECT CITY, LENGTH(CITY) AS len FROM STATION ORDER BY len ASC, CITY ASC LIMIT 1);

  • + 0 comments

    SELECT CITY, LENGTH(CITY) AS CityLength FROM STATION WHERE LENGTH(CITY) = ( SELECT MIN(LENGTH(CITY)) FROM STATION ) ORDER BY CITY LIMIT 1;

    SELECT CITY, LENGTH(CITY) AS CityLength FROM STATION WHERE LENGTH(CITY) = ( SELECT MAX(LENGTH(CITY)) FROM STATION ) ORDER BY CITY LIMIT 1;

  • + 0 comments

    select city,length(city) as city_length from station where length(city)=(select min(length(city))from station) order by city asc limit 1;

    select city,length(city) as city_length from station where length(city)=(select max(length(city))from station) order by city asc limit 1; /* so easy */