# Write your MySQL query statement below
select w1.id as Id
from Weather as w1 join Weather as w2
on datediff(w1.recordDate,w2.recordDate)=1
where w1.Temperature>w2.Temperature
学习点1:自连接,一般对表自己前后行做操作,会采用自连接。自己对自己做笛卡尔积。
学习点2:datediff()对日期数据做差
# Write your MySQL query statement below
select w1.id as Id
from Weather as w1 join Weather as w2
on datediff(w1.recordDate,w2.recordDate)=1
where w1.Temperature>w2.Temperature
学习点1:自连接,一般对表自己前后行做操作,会采用自连接。自己对自己做笛卡尔积。
学习点2:datediff()对日期数据做差