题目
思路
1、可以使用“diffdate(a.日期, b.日期) = 1”或者“timestampdiff(day, a.日期, b.日期) = -1”,以此为基准,提取表中的数据,这里先用diffdate进行操作
代码
select w2.id
from Weather w1, Weather w2
where datediff(w2.recordDate, w1.recordDate) = 1 and w2.Temperature > w1.Temperature
1、可以使用“diffdate(a.日期, b.日期) = 1”或者“timestampdiff(day, a.日期, b.日期) = -1”,以此为基准,提取表中的数据,这里先用diffdate进行操作
select w2.id
from Weather w1, Weather w2
where datediff(w2.recordDate, w1.recordDate) = 1 and w2.Temperature > w1.Temperature