일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 인프런sql강의
- sorted
- 알고리즘
- programmers
- Machine Learning
- 코세라강의
- 머신러닝강의
- map
- mysql
- 안드류응
- 프로그래머스SQL
- groupby
- orderby
- 머신러닝
- PYTHON
- WHERE
- SQL공부
- sql오답노트
- POP
- 경제공부
- coursera
- sql
- 코세라머신러닝
- Andrew NG
- 코세라머신러닝강의
- 코세라
- DATE_FORMAT
- 프로그래머스
- Algorithm
- 파이썬
- Today
- Total
목록casewhen (2)
미래를 예측하는 데이터분석가
[문제]The confirmation rate of a user is the number of 'confirmed' messages divided by the total number of requested confirmation messages. The confirmation rate of a user that did not request any confirmation messages is 0. Round the confirmation rate to two decimal places. Write a solution to find the confirmation rate of each user. Return the result table in any order. The result format is in t..

문제는 자동차 ID별로 22년10월16일 기준 그 자동차가 대여중인지 아닌지 구분하는 열을 만드는 것이다. 여기서 포인트는 날짜 별로 CAR_ID별로 여러 번 중복으로 대여 중이거나 대여한 이력이 한 TABLE안에 존재한다.어떻게 해당 날짜에 중복되어 대여중인지 구분할 수 있는가가 포인트 !!내 풀이SELECT CAR_ID, CASE WHEN SUM(CASE WHEN '2022-10-16' BETWEEN START_DATE AND END_DATE THEN 1 ELSE 0 END) = 0 THEN '대여 가능' ELSE '대여중' END AS AVAILABILITYFROM CAR_RENTAL_COMPANY_RENTAL..