문제
![](https://velog.velcdn.com/images%2Fcosmos%2Fpost%2Fb0df3353-741f-4abb-8f48-e0dcddf26742%2F%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202021-09-23%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%205.07.36.png)
![](https://velog.velcdn.com/images%2Fcosmos%2Fpost%2Fe93af00e-c0de-4a57-9510-c744efbbd4aa%2F%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202021-09-23%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%205.07.41.png)
풀이
- write an sql query to find all dates id with higher temperatures compared to ist previous dates (yesterday).
- return the result table in any order.
- the query result format is in the following example.
쿼리
SELECT T1.Id AS id
FROM Weather AS T1, Weather AS T2
WHERE T1.Temperature > T2.Temperature AND TO_DAYS(T1.RecordDate) - TO_DAYS(T2.RecordDate) = 1
결과
![](https://velog.velcdn.com/images%2Fcosmos%2Fpost%2F644fa91d-ca7a-433a-9399-5eaa14a0b424%2F%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202021-09-23%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%205.24.45.png)
![](https://velog.velcdn.com/images%2Fcosmos%2Fpost%2F066e590f-223c-4916-8b57-7afebb001a53%2F%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202021-09-23%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%205.24.55.png)
출처 && 깃허브
leetcode
github