Weather Observation Station 5

  • + 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;