티스토리 뷰
https://leetcode.com/problems/human-traffic-of-stadium
LeetCode - The World's Leading Online Programming Learning Platform
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
with base as (
select
distinct id, visit_date, people
, id - row_number() over (order by id) as rn
from Stadium
where people >= 100
)
, base2 as (
select
rn, count(distinct id) cnt
from base
group by 1
)
select
distinct id, visit_date, people
from base
where rn in (select distinct rn from base2 where cnt >= 3)
order by 2
'프로그래밍연습 > SQL' 카테고리의 다른 글
[SQL]friend-requests-ii-who-has-the-most-friends (0) | 2023.08.20 |
---|---|
[SQL]game-play-analysis-iv (0) | 2023.08.19 |
[SQL]trips-and-users (0) | 2023.08.18 |
[SQL]employees-earning-more-than-their-managers (0) | 2023.08.17 |
[SQL]consecutive-numbers (0) | 2023.08.17 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- hash
- 뇌하수체
- 조건부확률
- SQL
- 분당서울대병원
- leatcode
- 코딩테스트
- 확률분포
- random forest
- programmers
- 군고구마
- 쿠싱증후군
- 분산
- TensorFlow
- 프로그래머스
- 확률
- 상대도수
- Lambda
- neural network
- 쿠싱
- 사분위수
- counter
- 힙
- Python
- 상관관계
- 중앙값
- 평균
- 파이썬
- 통계
- 뇌하수체선종
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함