Data Analyst/SQL

[Hackerrank-SQL] Weather Observation Station 5

e_mily.dy 2021. 8. 1. 20:44
728x90

Query the two cities in STATION with the shortest and longest CITY names, as well as their respective lengths (i.e.: number of characters in the name). If there is more than one smallest or largest city, choose the one that comes first when ordered alphabetically.

이름이 가장 짧은 도시와 가장 긴 도시의 이름과 길이를 각각 추출하고,

만약 길이가 같다면 이름의 알파벳 순으로 출력해라.

[ORACLE]

*서브쿼리 (SubQuery)