LeetCode SQL 197. 上升的温度

阅读 74

2022-08-06


题目链接:​​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;


相关推荐

精彩评论(0)

0 0 举报