https://leetcode.com/problems/rising-temperature/description/
SELECT w1.id as Id
FROM Weather w1 , Weather w2
where w1.temperature > w2.temperature
and DATEDIFF(w1.recordDate, w2.recordDate) = 1
DATEDIFF 를 사용해서 self join으로 날짜의 차이를 구했습니다.
SELECT today.id as Id
FROM Weather AS today
INNER JOIN Weather AS yesterday on DATE_ADD(yesterday.recordDate, INTERVAL 1 DAY) = today.recordDate
WHERE today.temperature > yesterday.temperature;
MYSQL 시간 더하기, 빼기
-> DATE_ADD, DATE_SUB 사용 (기준날짜, INTERVAL)