leetcode-Database-197 |上升的温度

原题

在这里插入图片描述

思路

比较难懂的是题目的意思,比较一段日期,如果今天的日期比昨天日期的温度高,那么就查询出来。

代码

select w1.id
from weather as w1
left join weather as w2
on datediff(w1.RecordDate,w2.RecordDate)=1
where w2.RecordDate is not null and w1.Temperature>w2.Temperature

猜你喜欢

转载自blog.csdn.net/qq_38173650/article/details/114678882