编写一个 SQL 查询,来查找与之前(昨天的)日期相比温度更高的所有日期的 id 。
SELECT *
FROM weather a JOIN weather b
WHERE a.temperature > b.temperature AND DATEDIFF(a.`recordDate`,b.`recordDate`) = 1
两天间隔限制一天
DATEDIFF(a.recordDate
,b.recordDate
) = 1
编写一个 SQL 查询,来查找与之前(昨天的)日期相比温度更高的所有日期的 id 。
SELECT *
FROM weather a JOIN weather b
WHERE a.temperature > b.temperature AND DATEDIFF(a.`recordDate`,b.`recordDate`) = 1
两天间隔限制一天
DATEDIFF(a.recordDate
,b.recordDate
) = 1