티스토리 뷰
https://leetcode.com/problems/trips-and-users
select
t.request_at as Day
, round(1.00*count(distinct(if(t.status like 'cancel%', t.id, null)))/count(distinct t.id), 2) as 'Cancellation Rate'
from trips t
left join users u on t.client_id = u.users_id
and u.role = 'client' and u.banned = 'No'
left join users u2 on t.driver_id = u2.users_id
and u2.role = 'driver' and u2.banned = 'No'
where u.users_id is not null and u2.users_id is not null
and t.request_at between date('2013-10-01') and date('2013-10-03')
group by 1
'프로그래밍연습 > SQL' 카테고리의 다른 글
| [SQL]game-play-analysis-iv (0) | 2023.08.19 |
|---|---|
| [SQL]human-traffic-of-stadium (0) | 2023.08.18 |
| [SQL]employees-earning-more-than-their-managers (0) | 2023.08.17 |
| [SQL]consecutive-numbers (0) | 2023.08.17 |
| [SQL]SecondHighestSalary_leatcode (0) | 2023.08.17 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 코딩테스트
- counter
- 상관관계
- 확률
- 뇌하수체
- 통계
- 뇌하수체선종
- SQL
- 중앙값
- Lambda
- hash
- 분산
- TensorFlow
- 조건부확률
- Python
- 쿠싱증후군
- leatcode
- 프로그래머스
- 힙
- 사분위수
- 분당서울대병원
- 파이썬
- 상대도수
- 쿠싱
- 확률분포
- 평균
- programmers
- 군고구마
- neural network
- random forest
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함