LeetCode/릿코드-Rising Temperature-MySQL

cosmos·2021년 9월 23일
0
post-thumbnail
post-custom-banner

문제


풀이

  • 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.

쿼리

-- leetcode, Rising Temperature, mysql
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

결과


출처 && 깃허브

leetcode
github

post-custom-banner

0개의 댓글