Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 알고리즘
- 책리뷰
- 2020년 제4회 정보처리기사 필기 문제 분석
- 성적프로그램
- java
- 스터디
- 코드숨
- Til
- If
- LeetCode
- Jackson
- 주간회고
- 2020년 정보처리기사 4회
- 항해99
- 미니프로젝트
- 함수형 코딩
- 필기
- 정보처리기사
- post
- sqldeveloper
- algorithms
- 회고
- hackerrank
- 서평
- 뇌정리
- Real MySQL
- jsp
- Python
- 2020년 일정
- git
Archives
- Today
- Total
조컴퓨터
leetcode 197. Rising Temperature 본문
1) SELF JOIN
1-1)
SELECT *
FROM Weather w1, Weather w2
WHERE DATE_ADD(w1.recordDate, INTERVAL 1 DAY) = w2.recordDate
AND w1.Temperature < w2.Temperature
1-1) 결과
{"headers": ["Id", "RecordDate", "Temperature", "Id", "RecordDate", "Temperature"],
"values": [[1, "2015-01-01", 10, 2, "2015-01-02", 25], [3, "2015-01-03", 20, 4, "2015-01-04", 30]]}
2) w2.Id
2-1)
SELECT w2.Id AS Id
FROM Weather w1, Weather w2
WHERE DATE_ADD(w1.recordDate, INTERVAL 1 DAY) = w2.recordDate
AND w1.Temperature < w2.Temperature
2-1) 결과
{"headers": ["Id"], "values": [[2], [4]]}
SUCCESS!!
'LeetCode > SQL' 카테고리의 다른 글
leetcode 181. Employees Earning More Than Their Managers (0) | 2021.01.18 |
---|---|
leetcode 1179. Reformat Department Table (0) | 2021.01.18 |