上升的温度-leetcode


上升的温度

目录
  • 1. 地址
  • 2. 解法

这是一道使用 sql 语句编程的题目

1. 地址

https://leetcode-cn.com/problems/rising-temperature/

2. 解法

联表查询
注意联表的条件和取值

# Write your MySQL query statement below
select w1.Id
from Weather as w1, Weather as w2
where from_unixtime(unix_timestamp(w1.RecordDate) - 86400, '%Y-%m-%d') = w2.RecordDate 
and w1.Temperature > w2.Temperature