SQL/문제풀이 64

[LeetCode] Rising Temperature

https://leetcode.com/problems/rising-temperature/description/?envType=study-plan-v2&envId=top-sql-50 recordDate를 기준으로 JOIN (a가 previous day가 되도록) SELECT b.Id FROM weather a INNER JOIN weather b ON a.recordDate = b.recordDate - 1 -- a : yesterday WHERE a.temperature < b.temperature LEFT JOIN이 아닌 INNER JOIN을 써줘야 연속된 날짜를 구할 수 있다. DATE 계산을 조금 더 깔끔하게 적으면 이렇게 적을 수도 있다 ! SELECT w2.id FROM Weather w1 JO..

SQL/문제풀이 2024.03.01