Weather Observation Station 5

Sort by

recency

|

7097 Discussions

|

  • + 0 comments

    SELECT TOP 1 CITY, LEN (CITY) FROM STATION WHERE LEN(CITY) = ( SELECT MIN(LEN(CITY)) FROM STATION) ORDER BY CITY ASC

    SELECT TOP 1 CITY, LEN (CITY) FROM STATION WHERE LEN(CITY) = ( SELECT MAX(LEN(CITY)) FROM STATION) ORDER BY CITY ASC

  • + 0 comments

    I love how SQL lets you work with complex data sets in such a clean, readable way. betguru 247 net register

  • + 0 comments

    MYSQL

    select city, length(city) from station where length(city) in ( select min(length(city)) from station ) ORDER BY city asc limit 1; select city, length(city) from station where length(city) in ( select max(length(city)) from station ) ORDER BY city asc limit 1;

  • + 0 comments

    MySQL ----->

    SELECT CITY, LENGTH(CITY) FROM STATION ORDER BY LENGTH(CITY)ASC, CITY LIMIT 1; SELECT CITY, LENGTH(CITY) FROM STATION ORDER BY LENGTH(CITY)DESC, CITY LIMIT 1 `

  • + 0 comments

    In MS SQL Server

    select Top 1 city,len(city) as f from station ORDER BY f ASC , city ASC; select Top 1 city,len(city) as f from station ORDER BY f desc, city DESC;

    In DB2

    Select city,length(city) as name from station ORDER BY name, city asc fetch first 1 row only; Select city,length(city) as name from station ORDER BY name desc,city desc fetch first 1 row only;