LeetCode SQL 197. 上升的温度

题目链接:197. 上升的温度

Ideas

思路:用datediff将今天的记录和昨天的记录拼接起来,然后加一个and条件筛选。

Code

MySQL

select w1.id from weather as w1 join weather as w2 on datediff(w1.recordDate, w2.recordDate) = 1 and w1.Temperature > w2.Temperature;

猜你喜欢

转载自blog.csdn.net/weixin_43336281/article/details/126108399