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
|
6782 Discussions
|
Please Login in order to post a comment
**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;
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
(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);
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;
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 */