Notice
Recent Posts
Recent Comments
Link
250x250
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Python
- 프로그래머스
- 백준
- Lv. 2
- group by
- level 3
- dfs
- 소프티어
- Lv. 1
- SQL 고득점 KIT
- join
- 자바스크립트
- 오블완
- bfs
- programmers
- softeer
- 티스토리챌린지
- 동적계획법
- 깊이 우선 탐색
- javascript
- SQL
- 너비 우선 탐색
- 파이썬
- Baekjoon
- Dynamic Programming
- DP
- Lv. 3
- Lv. 0
- Java
- LEVEL 2
Archives
- Today
- Total
몸과 마음이 건전한 SW 개발자
[HackerRank-MSSQL] 해커랭크 basic select Weather Observation Station 4 본문
SQL/MSSQL
[HackerRank-MSSQL] 해커랭크 basic select Weather Observation Station 4
스위태니 2026. 4. 17. 10:55728x90
문제 링크
https://www.hackerrank.com/challenges/weather-observation-station-4/problem?isFullScreen=true
Weather Observation Station 4 | HackerRank
Find the number of duplicate CITY names in STATION.
www.hackerrank.com
정답 코드
SET NOCOUNT ON;
SELECT COUNT(CITY) - COUNT(DISTINCT CITY)
FROM STATION;
/*
Enter your query here.
Please append a semicolon ";" at the end of the query and enter your query in a single line to avoid error.
*/
go
풀이 과정
- 도시의 숫자를 세고 중복된 도시의 수를 센 다음 빼면 끝.

느낀점
- 아직 모르는 것이 많다.
- select로 찾아서 distinct하고 그럴 줄 알았는데 그냥 select에서 count로 세서 뺄 줄은 몰랐다.
728x90