-
[HackerRank/Basic Select] Weather Observation Station 5공부/PS ( SQL) 2022. 5. 15. 23:11
https://www.hackerrank.com/challenges/weather-observation-station-5/problem
문제
풀이
SELECT CITY, LENGTH(CITY) FROM STATION ORDER BY LENGTH(CITY), CITY LIMIT 1; SELECT CITY, LENGTH(CITY) FROM STATION ORDER BY LENGTH(CITY) DESC, CITY LIMIT 1
- 세미콜론(;) : 쿼리문을 연결해주는 역할
- ORDER BY A (ASC/DESC) , B (ASC/DESC) : 먼저 A 컬럼에 대해 정렬 후 B 컬럼에 대해 정렬함
'공부 > PS ( SQL)' 카테고리의 다른 글
[HackerRank/Basic Select] Weather Observation Station 7 (0) 2022.05.15 [HackerRank/Basic Select] Weather Observation Station 6 (0) 2022.05.15 [HackerRank/Basic Select] Weather Observation Station 4 (0) 2022.05.15 w3schools - sql exercise (1) (0) 2021.11.30 [HackerRank/Basic Select] Weather Observation Station 3 (0) 2021.09.24